mirror of
https://github.com/django/django.git
synced 2025-08-22 11:34:33 +00:00
Fixed #16137 - Removed kwargs requirement for QuerySet.get_or_create
Thanks wilfred@, poirier, and charettes for work on the patch.
This commit is contained in:
parent
a64de33b79
commit
90af278203
5 changed files with 23 additions and 5 deletions
|
@ -363,8 +363,6 @@ class QuerySet(object):
|
|||
Returns a tuple of (object, created), where created is a boolean
|
||||
specifying whether an object was created.
|
||||
"""
|
||||
assert kwargs, \
|
||||
'get_or_create() must be passed at least one keyword argument'
|
||||
defaults = kwargs.pop('defaults', {})
|
||||
lookup = kwargs.copy()
|
||||
for f in self.model._meta.fields:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue