1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

[soc2010/query-refactor] Fixed querying for objects by their related objects (by their primary keys).

git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13431 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2010-07-13 19:33:43 +00:00
parent d83203cb07
commit 536a5ca514
2 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,7 @@ from django.utils.importlib import import_module
class DatabaseFeatures(object): class DatabaseFeatures(object):
interprets_empty_strings_as_nulls = False interprets_empty_strings_as_nulls = False
sql_nulls = False sql_nulls = False
related_fields_match_type = False
class DatabaseOperations(object): class DatabaseOperations(object):

View File

@ -82,6 +82,9 @@ class MongoTestCase(TestCase):
self.assertEqual(b.current_group_id, e.pk) self.assertEqual(b.current_group_id, e.pk)
self.assertFalse(hasattr(b, "_current_group_cache")) self.assertFalse(hasattr(b, "_current_group_cache"))
self.assertEqual(b.current_group, e) self.assertEqual(b.current_group, e)
self.assertEqual(Artist.objects.get(current_group=e), b)
self.assertEqual(Artist.objects.get(current_group__id=e.pk), b)
def test_exists(self): def test_exists(self):
self.assertFalse(Artist.objects.filter(name="Brian May").exists()) self.assertFalse(Artist.objects.filter(name="Brian May").exists())