I have a mixin:
{{{
class PublishableMixin(object):
publish_date = models.DateTimeField()
}}}
and a model I wish to use it in:
{{{
class Article(PublishableMixin, models.Model):
slug = models.SlugField()
class Meta:
unique_together = ('publish_date', 'slug')
}}}
This fails at the system check level:
news.Article: (models.E012) 'unique_together' refers to the non-existent
field 'publish_date'.
--
Ticket URL: <https://code.djangoproject.com/ticket/23779>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0
Comment:
You need to use abstract models as described
[https://docs.djangoproject.com/en/dev/topics/db/models/#model-inheritance
in the documentation] (not inherit from `object`). If something isn't
clear there about that, could you open a documentation ticket? Thanks!
--
Ticket URL: <https://code.djangoproject.com/ticket/23779#comment:1>