1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

newforms-admin: Merged from trunk up to [7583].

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7584 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Brian Rosner
2008-06-07 17:10:16 +00:00
parent 0836745c8e
commit 453d560a94
41 changed files with 763 additions and 373 deletions

View File

@@ -401,8 +401,9 @@ True
# The 'select' argument to extra() supports names with dashes in them, as long
# as you use values().
>>> Article.objects.filter(pub_date__year=2008).extra(select={'dashed-value': '1'}).values('headline', 'dashed-value')
[{'headline': u'Article 11', 'dashed-value': 1}, {'headline': u'Article 12', 'dashed-value': 1}]
>>> dicts = Article.objects.filter(pub_date__year=2008).extra(select={'dashed-value': '1'}).values('headline', 'dashed-value')
>>> [sorted(d.items()) for d in dicts]
[[('dashed-value', 1), ('headline', u'Article 11')], [('dashed-value', 1), ('headline', u'Article 12')]]
# If you use 'select' with extra() and names containing dashes on a query
# that's *not* a values() query, those extra 'select' values will silently be