#14353 closed (worksforme)
unique_together new style is not working properly
Reported by: | draxus | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.2 |
Severity: | Keywords: | unique, restriction | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
As you say in django docs: http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together
unique_together = ("driver", "restaurant") <- this way doesn't create the unique restrictions in the DB
unique_together = (("driver", "restaurant"),) <- this way works great
Change History (2)
comment:1 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 14 years ago
Today is working in both ways. What a mistery...
I will reopen this ticket if it happens again. Thank you very much for your answer.
Note:
See TracTickets
for help on using tickets.
Tested this with Django 1.1, 1.2.X and trunk plus sqlite3 with the following model:
using both forms of
unique_together
. In all cases the SQL generated (manage.py sqlall <app name>
) is:We'd need more details about you setup (exact Django version, revision and DB backend you are using) and a minimal example like the one above demonstrating the issue.