Ticket #7252: inheritance_manager_fix.diff

File inheritance_manager_fix.diff, 553 bytes (added by floguy, 16 years ago)
  • django/db/models/manager.py

    diff --git a/django/db/models/manager.py b/django/db/models/manager.py
    index 3a9da34..2e83ad2 100644
    a b class ManagerDescriptor(object):  
    138138    def __get__(self, instance, type=None):
    139139        if instance != None:
    140140            raise AttributeError, "Manager isn't accessible via %s instances" % type.__name__
     141        if type is not None and self.manager.model != type:
     142            self.manager.model = type
    141143        return self.manager
    142144
    143145class EmptyManager(Manager):
Back to Top