X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c8a89a63dc764612717e7a30e3e1d398606b1b22..8bd5af0d1af393ad09e7fc162dc6ad82548bfbe1:/newtagging/models.py?ds=sidebyside diff --git a/newtagging/models.py b/newtagging/models.py index 7ce5950bd..0c2b0e1f0 100644 --- a/newtagging/models.py +++ b/newtagging/models.py @@ -8,7 +8,6 @@ if not hasattr(__builtins__, 'set'): from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.db import connection, models -from django.db.models.query import QuerySet from django.utils.translation import ugettext_lazy as _ from django.db.models.base import ModelBase @@ -484,9 +483,9 @@ class TagMeta(ModelBase): model = super(TagMeta, cls).__new__(cls, name, bases, attrs) if not model._meta.abstract: # Create an intermediary table and register custom managers for concrete models - intermediary_table_model = create_intermediary_table_model(model) - TagManager(intermediary_table_model).contribute_to_class(model, 'objects') - TaggedItemManager(model).contribute_to_class(intermediary_table_model, 'objects') + model.intermediary_table_model = create_intermediary_table_model(model) + TagManager(model.intermediary_table_model).contribute_to_class(model, 'objects') + TaggedItemManager(model).contribute_to_class(model.intermediary_table_model, 'objects') return model