1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

[soc2009/multidb] Fixed the usage of the connection during Query construction, and defer it until actual SQL construction. In practice this means the GROUP BY optimization we do will be correctly applied based on the connection the Query is executed against, as oppossed to the on the QuerySet is targeting at the time the GROUP BY items are added

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@10934 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor
2009-06-06 19:38:29 +00:00
parent 6aca03c24d
commit 4d6c6d0596
4 changed files with 11 additions and 6 deletions

View File

@@ -49,3 +49,10 @@ class QueryTestCase(TestCase):
dive = Book.objects.using(db).get(title__icontains="dive")
self.assertEqual(dive.title, "Dive into Python")
dive = Book.objects.using(db).get(title__iexact="dive INTO python")
self.assertEqual(dive.title, "Dive into Python")
pro = Book.objects.using(db).get(published__year=2008)
self.assertEqual(pro.title, "Pro Django")
self.assertEqual(pro.published, datetime.date(2008, 12, 16))