I am new to django and need some quick help.
How will the following sql statement be translated in django ORM?
SELECT * from table_name WHERE field1 = v1 OR field2 = v2
Thanks in advance!
I am new to django and need some quick help.
How will the following sql statement be translated in django ORM?
SELECT * from table_name WHERE field1 = v1 OR field2 = v2
Thanks in advance!
Use Q-objects:
Model.objects.filter(Q(field1=v1) | Q(field2=v2))