#3270 closed defect (duplicate)
IntegrityError when using unique_together in model in admin interface
| Reported by: | anonymous | Owned by: | Adrian Holovaty |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | normal | Keywords: | IntegrityError |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
I am using a model with unique_together. It looks similiar to this:
class Poll(models.Model):
...
class Vote(models.Model):
vote = models.IntegerField("Vote", choices=Registration_Choice)
poll = models.ForeignKey(Poll)
user = models.ForeignKey(User)
class Meta:
unique_together = (('poll', 'user'),)
When I use the admin webinterface and create an Vote-Object with an not unique combination of poll and user, it will raise an unhandled IntegrityError.
Change History (3)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
This seems to be a duplicate of #1751.
comment:3 by , 19 years ago
Gary,
I was waiting the answer from the poster of the ticket to be sure to mark it as a dupe of one of the existing reports. I wanted to know if she/he is using MySQL.
Anyways, it's good to see some activity here.
Note:
See TracTickets
for help on using tickets.
To the person who filed this bug:
What database backend are you using?.
And just to confirm it: you are using the latest version of Django checked out from SVN, right?