Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[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
  • Loading branch information...
commit 536a5ca51466e3de0b19351dc826710a1e159cf5 1 parent d83203c
@alex alex authored
View
1  django/contrib/mongodb/base.py
@@ -10,6 +10,7 @@
class DatabaseFeatures(object):
interprets_empty_strings_as_nulls = False
sql_nulls = False
+ related_fields_match_type = False
class DatabaseOperations(object):
View
3  tests/regressiontests/mongodb/tests.py
@@ -82,6 +82,9 @@ def test_foreignkey(self):
self.assertEqual(b.current_group_id, e.pk)
self.assertFalse(hasattr(b, "_current_group_cache"))
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):
self.assertFalse(Artist.objects.filter(name="Brian May").exists())
Please sign in to comment.
Something went wrong with that request. Please try again.