Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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 Gaynor alex authored
1  django/contrib/mongodb/base.py
@@ -10,6 +10,7 @@
10 10 class DatabaseFeatures(object):
11 11 interprets_empty_strings_as_nulls = False
12 12 sql_nulls = False
  13 + related_fields_match_type = False
13 14
14 15
15 16 class DatabaseOperations(object):
3  tests/regressiontests/mongodb/tests.py
@@ -82,6 +82,9 @@ def test_foreignkey(self):
82 82 self.assertEqual(b.current_group_id, e.pk)
83 83 self.assertFalse(hasattr(b, "_current_group_cache"))
84 84 self.assertEqual(b.current_group, e)
  85 +
  86 + self.assertEqual(Artist.objects.get(current_group=e), b)
  87 + self.assertEqual(Artist.objects.get(current_group__id=e.pk), b)
85 88
86 89 def test_exists(self):
87 90 self.assertFalse(Artist.objects.filter(name="Brian May").exists())

0 comments on commit 536a5ca

Please sign in to comment.
Something went wrong with that request. Please try again.