#34311: Update serialization examples from unique_together to UniqueConstraint
-------------------------------------+-------------------------------------
Reporter: Willem Van Onsem | Owner: Willem
Type: | Van Onsem
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 4.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Waqar ALi):
I believe you're confusing model meta option `constratins` with
`unique_together`. `UniqueConstraint` is a DB constraint assigned to
constraints option in Meta whereas unique together is another option on
Meta level.
{{{
class Mymodel(model):
class Meta:
unique_together = [ 'field1', 'field2' ]
constratints = [ UniqueConstraint ]
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34311#comment:4>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018622ff93e7-16492503-220e-485d-bdaf-72c16ef74ca1-000000%40eu-central-1.amazonses.com.