Opened 8 years ago

Closed 8 years ago

Last modified 5 years ago

#8209 closed (fixed)

ModelForms (and hence the admin) don't check unique constraints

Reported by: glenjamin Owned by: Alex Gaynor
Component: Forms Version: master
Severity: Keywords: 1.0-blocker
Cc: tomek+django@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Jacob)

They don't - in fact in SQLite a raw exception is propagated all the way up.

Attachments (7)

8209_model_forms_unique.diff (3.7 KB) - added by David Gouldin 8 years ago.
django-r8769-8209.diff (5.4 KB) - added by Alex Gaynor 8 years ago.
django-r8769-8209.2.diff (5.7 KB) - added by Alex Gaynor 8 years ago.
Fixed merge errors with latest trunk
8209_modelform_unique_validation.1.diff (11.5 KB) - added by Brian Rosner 8 years ago.
added a patch for review
django-8209.diff (11.6 KB) - added by Alex Gaynor 8 years ago.
Tiny change from brosner's patch
django-8209.2.diff (12.1 KB) - added by Alex Gaynor 8 years ago.
New patch
django-8209.3.diff (11.9 KB) - added by Alex Gaynor 8 years ago.
Removed usage of any

Download all attachments as: .zip

Change History (19)

comment:1 Changed 8 years ago by Jacob

Component: DocumentationForms
Description: modified (diff)
milestone: 1.0
Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Summary: Admin documentation claims that uniqueness is enforced in the interfaceModelForms (and hence the admin) don't check unique constraints
Triage Stage: UnreviewedAccepted

Actually, I think ModelForms need to learn how to understand the unique stuff. I'm hijaking this ticket for that :)

comment:2 Changed 8 years ago by Tomek Paczkowski

Cc: tomek+django@… added

comment:3 Changed 8 years ago by cmarshal

Owner: changed from nobody to cmarshal
Status: newassigned

comment:4 Changed 8 years ago by David Gouldin

Owner: changed from cmarshal to David Gouldin
Status: assignednew

Changed 8 years ago by David Gouldin

comment:5 Changed 8 years ago by Gary Wilson

Owner: changed from David Gouldin to Gary Wilson
Status: newassigned

comment:6 Changed 8 years ago by Alex Gaynor

Owner: changed from Gary Wilson to Alex Gaynor
Status: assignednew

I've got a patch that I will upload shortly.

Changed 8 years ago by Alex Gaynor

Attachment: django-r8769-8209.diff added

Changed 8 years ago by Alex Gaynor

Attachment: django-r8769-8209.2.diff added

Fixed merge errors with latest trunk

comment:7 Changed 8 years ago by Jacob

Keywords: 1.0-blocker added

Changed 8 years ago by Brian Rosner

added a patch for review

comment:8 Changed 8 years ago by Brian Rosner

Added an improved patch to deal with formsets and save_as_new stuff.

comment:9 Changed 8 years ago by Antti Kaihola

Has patch: set

Changed 8 years ago by Alex Gaynor

Attachment: django-8209.diff added

Tiny change from brosner's patch

comment:10 Changed 8 years ago by Alex Gaynor

Ignore my patch in favor of brosners.

Changed 8 years ago by Alex Gaynor

Attachment: django-8209.2.diff added

New patch

Changed 8 years ago by Alex Gaynor

Attachment: django-8209.3.diff added

Removed usage of any

comment:11 Changed 8 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [8805]) Fixed #8209: ModelForms now validate unique constraints. Alex Gaynor did much of this work, and Brian Rosner helped as well.

comment:12 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top