Ticket #11760: MtoM_abstract_through.patch

File MtoM_abstract_through.patch, 645 bytes (added by MS, 15 years ago)

Patch for django/db/models/fields/related.py to use through in ManyToMany Field of an abstact class

  • related.py

     
    934934        if isinstance(self.rel.through, basestring):
    935935            def resolve_through_model(field, model, cls):
    936936                field.rel.through_model = model
     937            if not cls._meta.abstract and self.rel.through:
     938                self.rel.through = self.rel.through % {'class': cls.__name__}
    937939            add_lazy_relation(cls, self, self.rel.through, resolve_through_model)
    938940        elif self.rel.through:
    939941            self.rel.through_model = self.rel.through
Back to Top