|
|
|
|
|
by collyw
3649 days ago
|
|
In most cases its smaller (in the Django ORM anyway). myobject, created = MyObject.objects.get_or_create(field1='1' , field2=field2) That would take a number of lines. One query to check if the object exists, another to create it / retrieve it, plus application code to deal with that SQL. |
|