fix BaseQueryWrapper.first()
This commit is contained in:
parent
6c33a8a41b
commit
4fd1968ff7
1 changed files with 2 additions and 0 deletions
|
@ -673,6 +673,8 @@ class BaseQueryWrapper(BaseWrapper):
|
|||
|
||||
@get_queryset
|
||||
def first(self):
|
||||
if self._created_pks:
|
||||
return next(self._get_created_objects())
|
||||
first = self._obj.first()
|
||||
if first is not None:
|
||||
first = self._wrap_instance(first)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue