我有以下mixins:
class AbandonableMixin(object):
is_abandoned = models.BooleanField(
default=False, verbose_name=_('Abandoned?'))
class ReadyMixin(object):
is_ready = models.BooleanField(
default=False, verbose_name=_('Ready?'))
class StoppableMixin(object):
is_stopped = models.BooleanField(
default=False, verbose_name=_('Stopped?'))
我想像普通的mixin一样在类中使用它们:
class MyObject(models.Model, AbandonableMixin, StoppableMixin):
...
class MySecondObject(models.Model, ReadyMixin, StoppableMixin):
...
这将导致以下错误:
TypeError: Cannot create a consistent method resolution
order (MRO) for bases Model, AbandonableMixin
我在做什么错?