Commit aca6079a by Florian Apolloner

Fixed Django 1.7 support.

parent e8642cbc
from __future__ import unicode_literals
from django import VERSION
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
......@@ -72,7 +73,10 @@ class TaggableManager(RelatedField, Field):
return manager
def contribute_to_class(self, cls, name):
self.name = self.column = name
if VERSION < (1, 7):
self.name = self.column = name
else:
self.set_attributes_from_name(name)
self.model = cls
cls._meta.add_field(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