mirror of
https://github.com/django/django.git
synced 2025-04-14 20:34:36 +00:00
magic-removal: Fixed bug with .values() when no arguments are passed, and added test for it
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2197 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
5b34ff236a
commit
34bf9e8d31
@ -217,7 +217,7 @@ class QuerySet(object):
|
||||
if not rows:
|
||||
raise StopIteration
|
||||
for row in rows:
|
||||
yield dict(zip(fields, row))
|
||||
yield dict(zip(columns, row))
|
||||
|
||||
def dates(self, field_name, kind, order='ASC'):
|
||||
"""
|
||||
|
@ -103,6 +103,10 @@ True
|
||||
[('headline', 'Article 7'), ('id', 7)]
|
||||
[('headline', 'Article 1'), ('id', 1)]
|
||||
|
||||
# if you don't specify which fields, all are returned
|
||||
>>> list(Article.objects.filter(id=5).values()) == [{'id': 5, 'headline': 'Article 5', 'pub_date': datetime(2005, 8, 1, 9, 0)}]
|
||||
True
|
||||
|
||||
# Every DateField and DateTimeField creates get_next_by_FOO() and
|
||||
# get_previous_by_FOO() methods.
|
||||
# In the case of identical date values, these methods will use the ID as a
|
||||
|
Loading…
x
Reference in New Issue
Block a user