Author: Alex
Date: 2010-07-13 14:33:43 -0500 (Tue, 13 Jul 2010)
New Revision: 13431

Modified:
   django/branches/soc2010/query-refactor/django/contrib/mongodb/base.py
   django/branches/soc2010/query-refactor/tests/regressiontests/mongodb/tests.py
Log:
[soc2010/query-refactor] Fixed querying for objects by their related objects 
(by their primary keys).

Modified: django/branches/soc2010/query-refactor/django/contrib/mongodb/base.py
===================================================================
--- django/branches/soc2010/query-refactor/django/contrib/mongodb/base.py       
2010-07-13 19:17:41 UTC (rev 13430)
+++ django/branches/soc2010/query-refactor/django/contrib/mongodb/base.py       
2010-07-13 19:33:43 UTC (rev 13431)
@@ -10,6 +10,7 @@
 class DatabaseFeatures(object):
     interprets_empty_strings_as_nulls = False
     sql_nulls = False
+    related_fields_match_type = False
 
 
 class DatabaseOperations(object):

Modified: 
django/branches/soc2010/query-refactor/tests/regressiontests/mongodb/tests.py
===================================================================
--- 
django/branches/soc2010/query-refactor/tests/regressiontests/mongodb/tests.py   
    2010-07-13 19:17:41 UTC (rev 13430)
+++ 
django/branches/soc2010/query-refactor/tests/regressiontests/mongodb/tests.py   
    2010-07-13 19:33:43 UTC (rev 13431)
@@ -82,6 +82,9 @@
         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())

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to