While going through the code for ModelBase for reviewing [1] it is unclear
to me when inheriting from 2 Abstract models which define Managers, if the
concrete model should use the first manager according to the creation
counter or it should follow the MRO. I would expect the following test to
pass. I would appreciate if someone can confirm that this is a bug so we
should open a trac ticket and fix this.
@isolate_apps('managers_regress')
def test_multi_abstract_model_inheritance_manager_mro(self):
from django.db.models.manager import Manager
class Manager1(Manager):
pass
class Manager2(Manager):
pass
class AbstractModel1(models.Model):
custom_manager = Manager1()
class Meta:
abstract = True
class AbstractModel2(models.Model):
custom_manager = Manager2()
class ConcreteModel(AbstractModel2, AbstractModel1):
pass
self.assertIsInstance(ConcreteModel.custom_manager, Manager2)
self.assertIsInstance(ConcreteModel._default_manager, Manager2)
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/8e267ae3-bd78-40d7-aceb-bddb3e98e317%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.