Ticket #16865: patch_16865_get_or_create_move_for_write.diff
File patch_16865_get_or_create_move_for_write.diff, 615 bytes (added by , 12 years ago) |
---|
-
django/db/models/query.py
diff --git a/django/db/models/query.py b/django/db/models/query.py index 82378fb..566e910 100644
a b class QuerySet(object): 441 441 if f.attname in lookup: 442 442 lookup[f.name] = lookup.pop(f.attname) 443 443 try: 444 self._for_write = True445 444 return self.get(**lookup), False 446 445 except self.model.DoesNotExist: 446 self._for_write = True 447 447 try: 448 448 params = dict([(k, v) for k, v in kwargs.items() if '__' not in k]) 449 449 params.update(defaults)