mirror of
https://github.com/django/django.git
synced 2025-10-30 00:56:09 +00:00
Fixed #19151 -- Added missing methods to EmptyQuerySet.
Added values() and values_list() methods to EmptyQuerySet.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user