Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10274 -- Fixed an embarrassing mistake in BaseGenericInlineFor…

…mSet.get_queryset. Thanks Zak Johnson for the report and akaihola for the patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9886 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4bd24474c02a6f3c70e8111ac262fabf2fc5f454 1 parent 13d3d9d
Brian Rosner authored February 23, 2009
2  django/contrib/contenttypes/generic.py
@@ -307,7 +307,7 @@ def get_queryset(self):
307 307
         # Avoid a circular import.
308 308
         from django.contrib.contenttypes.models import ContentType
309 309
         if self.instance is None:
310  
-            return self.model._default_manager.empty()
  310
+            return self.model._default_manager.none()
311 311
         return self.model._default_manager.filter(**{
312 312
             self.ct_field.name: ContentType.objects.get_for_model(self.instance),
313 313
             self.ct_fk_field.name: self.instance.pk,
5  tests/modeltests/generic_relations/models.py
@@ -219,6 +219,11 @@ def __unicode__(self):
219 219
 >>> from django.contrib.contenttypes.generic import generic_inlineformset_factory
220 220
 
221 221
 >>> GenericFormSet = generic_inlineformset_factory(TaggedItem, extra=1)
  222
+>>> formset = GenericFormSet()
  223
+>>> for form in formset.forms:
  224
+...     print form.as_p()
  225
+<p><label for="id_generic_relations-taggeditem-content_type-object_id-0-tag">Tag:</label> <input id="id_generic_relations-taggeditem-content_type-object_id-0-tag" type="text" name="generic_relations-taggeditem-content_type-object_id-0-tag" maxlength="50" /></p> 
  226
+<p><label for="id_generic_relations-taggeditem-content_type-object_id-0-DELETE">Delete:</label> <input type="checkbox" name="generic_relations-taggeditem-content_type-object_id-0-DELETE" id="id_generic_relations-taggeditem-content_type-object_id-0-DELETE" /><input type="hidden" name="generic_relations-taggeditem-content_type-object_id-0-id" id="id_generic_relations-taggeditem-content_type-object_id-0-id" /></p>
222 227
 >>> formset = GenericFormSet(instance=Animal())
223 228
 >>> for form in formset.forms:
224 229
 ...     print form.as_p()

0 notes on commit 4bd2447

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