Commit aca6079a by Florian Apolloner

Fixed Django 1.7 support.

parent e8642cbc
from __future__ import unicode_literals from __future__ import unicode_literals
from django import VERSION
from django.contrib.contenttypes.generic import GenericRelation from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.db import models from django.db import models
...@@ -72,7 +73,10 @@ class TaggableManager(RelatedField, Field): ...@@ -72,7 +73,10 @@ class TaggableManager(RelatedField, Field):
return manager return manager
def contribute_to_class(self, cls, name): def contribute_to_class(self, cls, name):
if VERSION < (1, 7):
self.name = self.column = name self.name = self.column = name
else:
self.set_attributes_from_name(name)
self.model = cls self.model = cls
cls._meta.add_field(self) cls._meta.add_field(self)
setattr(cls, name, self) setattr(cls, name, self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment