Remove Django 1.1 compatibility switch

fix_request_path_info
Diederik van der Boor 2013-05-20 23:54:17 +02:00
parent fed810b336
commit ff22332d2c
1 changed files with 1 additions and 7 deletions

View File

@ -17,7 +17,6 @@ from __future__ import absolute_import
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django import VERSION as django_VERSION
from django.utils import six
from .base import PolymorphicModelBase
@ -57,13 +56,8 @@ class PolymorphicModel(six.with_metaclass(PolymorphicModelBase, models.Model)):
abstract = True
# avoid ContentType related field accessor clash (an error emitted by model validation)
# we really should use both app_label and model name, but this is only possible since Django 1.2
if django_VERSION[0] <= 1 and django_VERSION[1] <= 1:
p_related_name_template = 'polymorphic_%(class)s_set'
else:
p_related_name_template = 'polymorphic_%(app_label)s.%(class)s_set'
polymorphic_ctype = models.ForeignKey(ContentType, null=True, editable=False,
related_name=p_related_name_template)
related_name='polymorphic_%(app_label)s.%(class)s_set')
# some applications want to know the name of the fields that are added to its models
polymorphic_internal_model_fields = ['polymorphic_ctype']