Can Django be a variable in the case of filter or get, etc., where the conditional name (field name) is a variable?

for example, filter a model

models.objects.get(***field_name***=conditions)

my question is, can field_name be the result of a variable? For example,

field_list = {"field_name": name}
models.objects.get(field_list["field_name"]=conditions)

field_list = [name, age, gender, ...]
models.objects.get(field_list[0]=conditions)

is there any way to achieve this effect? The methods I have tried so far, such as getattr, etc., have no effect

Apr.16,2021

var = "field_name"
field_list = {var:conditions}
-sharp field_list {"field_name":conditions}
models.objects.get(**field_list)
-sharp models.objects.get(**field_list) = models.objects.get(key=conditions)

* * kwargs takes the kv key-value pair in the dictionary as an argument to the function in KFV format. The key of the dictionary can be set through variables. Of course, it must be a string.

Menu