mirror of
https://github.com/django/django.git
synced 2025-09-23 10:42:45 +00:00
Fixed #19151 -- Added missing methods to EmptyQuerySet.
Added values() and values_list() methods to EmptyQuerySet.
This commit is contained in:
parent
d7c6a57d60
commit
b87e2f46c8
2 changed files with 19 additions and 0 deletions
|
@ -1271,6 +1271,18 @@ class EmptyQuerySet(QuerySet):
|
|||
kwargs[arg.default_alias] = arg
|
||||
return dict([(key, None) for key in kwargs])
|
||||
|
||||
def values(self, *fields):
|
||||
"""
|
||||
Always returns EmptyQuerySet.
|
||||
"""
|
||||
return self
|
||||
|
||||
def values_list(self, *fields, **kwargs):
|
||||
"""
|
||||
Always returns EmptyQuerySet.
|
||||
"""
|
||||
return self
|
||||
|
||||
# EmptyQuerySet is always an empty result in where-clauses (and similar
|
||||
# situations).
|
||||
value_annotation = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue