Commit 20a8063c by Florian Apolloner

Revert "Removed useless code, two GFK to one model don't work anyways…"

This reverts commit 188182b9.
parent e0d3de77
......@@ -125,7 +125,9 @@ class TaggableManager(RelatedField, Field):
self.rel.to = self.through._meta.get_field("tag").rel.to
self.related = RelatedObject(self.through, cls, self)
if self.use_gfk:
tagged_items = GenericRelation(self.through)
self.__class__._related_name_counter += 1
related_name = '+%d' % self.__class__._related_name_counter
tagged_items = GenericRelation(self.through, related_name=related_name)
tagged_items.contribute_to_class(cls, 'tagged_items')
def save_form_data(self, instance, value):
......
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