#23779: Can't use unique_together if one of the fields is in a mixin
----------------------------------------------+--------------------
Reporter: knyghty | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Slightly related to https://code.djangoproject.com/ticket/16732
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.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/050.3e2b9a4df8c7de77462f5d3eb5e33879%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.