diff options
| author | Alex Gaynor <alex.gaynor@rd.io> | 2012-11-04 13:54:54 -0800 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@rd.io> | 2012-11-04 13:58:40 -0800 |
| commit | b98083ce3dfc35a3f3732f4873761a3f78e4194f (patch) | |
| tree | 4872055c80707bb33c10e7da3c9ae3fc35685be1 | |
| parent | aee9c7b094cbd36c898ea465269935f156412ab9 (diff) | |
Remove some bizzare and unnecesary code.
| -rw-r--r-- | django/contrib/contenttypes/generic.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/django/contrib/contenttypes/generic.py b/django/contrib/contenttypes/generic.py index 726f4aa150..2dc66d07e1 100644 --- a/django/contrib/contenttypes/generic.py +++ b/django/contrib/contenttypes/generic.py @@ -18,6 +18,7 @@ from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets from django.contrib.contenttypes.models import ContentType from django.utils.encoding import smart_text + class GenericForeignKey(object): """ Provides a generic relation to any object through content-type/object-id @@ -51,9 +52,6 @@ class GenericForeignKey(object): kwargs[self.fk_field] = value._get_pk_val() def get_content_type(self, obj=None, id=None, using=None): - # Convenience function using get_model avoids a circular import when - # using this model - ContentType = get_model("contenttypes", "contenttype") if obj: return ContentType.objects.db_manager(obj._state.db).get_for_model(obj) elif id: @@ -215,7 +213,6 @@ class GenericRelation(RelatedField, Field): """ if negate: return [] - ContentType = get_model("contenttypes", "contenttype") content_type = ContentType.objects.get_for_model(self.model) prefix = "__".join(pieces[:pos + 1]) return [("%s__%s" % (prefix, self.content_type_field_name), |
