I have a query
variable3 = "Field3"
variable_gte = "flowrate__gte"
x = mytable.objects.filter(Q((variable_gte, variable2))).order_by(variable3)[0:5]
z = x[0].Field3
How can I call this last value z using variable3, something similar to z = x[0].variable3
If it is impossible, I will need to use if/else condition:
if variable3 = "Field3":
z = x[0].Field3
else:
....
Thank you.