

def contribute_to_class(self, cls, name):
    self.name = self.column = name
    self.model = cls
    cls._meta.add_field(self)
    setattr(cls, name, self)
    if (not cls._meta.abstract):
        if isinstance(self.through, basestring):

            def resolve_related_class(field, model, cls):
                self.through = model
                self.post_through_setup(cls)
            add_lazy_relation(cls, self, self.through, resolve_related_class)
        else:
            self.post_through_setup(cls)

dataset/ETHPy150Open lmorchard/badg.us/vendor-local/lib/python/taggit/managers.py TaggableManager.contribute_to_class/original