Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove some bizzare and unnecesary code.

  • Loading branch information...
commit b98083ce3dfc35a3f3732f4873761a3f78e4194f 1 parent aee9c7b
authored November 04, 2012

Showing 1 changed file with 1 addition and 4 deletions. Show diff stats Hide diff stats

  1. 5  django/contrib/contenttypes/generic.py
5  django/contrib/contenttypes/generic.py
@@ -18,6 +18,7 @@
18 18
 from django.contrib.contenttypes.models import ContentType
19 19
 from django.utils.encoding import smart_text
20 20
 
  21
+
21 22
 class GenericForeignKey(object):
22 23
     """
23 24
     Provides a generic relation to any object through content-type/object-id
@@ -51,9 +52,6 @@ def instance_pre_init(self, signal, sender, args, kwargs, **_kwargs):
51 52
             kwargs[self.fk_field] = value._get_pk_val()
52 53
 
53 54
     def get_content_type(self, obj=None, id=None, using=None):
54  
-        # Convenience function using get_model avoids a circular import when
55  
-        # using this model
56  
-        ContentType = get_model("contenttypes", "contenttype")
57 55
         if obj:
58 56
             return ContentType.objects.db_manager(obj._state.db).get_for_model(obj)
59 57
         elif id:
@@ -215,7 +213,6 @@ def extra_filters(self, pieces, pos, negate):
215 213
         """
216 214
         if negate:
217 215
             return []
218  
-        ContentType = get_model("contenttypes", "contenttype")
219 216
         content_type = ContentType.objects.get_for_model(self.model)
220 217
         prefix = "__".join(pieces[:pos + 1])
221 218
         return [("%s__%s" % (prefix, self.content_type_field_name),

0 notes on commit b98083c

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