Fixed #19151 -- Added missing methods to EmptyQuerySet.

Added values() and values_list() methods to EmptyQuerySet.
This commit is contained in:
Jan Bednařík 2012-10-21 00:11:16 +02:00
parent d7c6a57d60
commit b87e2f46c8
2 changed files with 19 additions and 0 deletions

View file

@ -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