Opened 16 years ago

Closed 16 years ago

Last modified 12 years ago

#7790 closed (fixed)

New validator for ModelAdmin classes should use explicitly declared forms for validation if appropriate

Reported by: Rozza Owned by: Brian Rosner
Component: contrib.admin Version: newforms-admin
Severity: Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Ticket #5374 Introduced automatic modeladmin validation if you have settings.DEBUG set to True - see r7929

However, this change doesn't handle customized forms for admin because it couples admin form fields 1-1 to the model.

The validator should check against any explicitly declared forms to ensure that the form is valid. Therefore allowing greater flexibility by allowing some decoupling from the model so that admin forms are customizable

Patch including tests attached

Attachments (1)

validation.py.patch (2.3 KB ) - added by Rozza 16 years ago.
Patch to validation.py and added test cases to modeladmin/models.py

Download all attachments as: .zip

Change History (6)

by Rozza, 16 years ago

Attachment: validation.py.patch added

Patch to validation.py and added test cases to modeladmin/models.py

comment:1 by anonymous, 16 years ago

Keywords: nfa-blocker added; BLOCKER newforms admin validation removed
Owner: changed from nobody to anonymous
Status: newassigned
Triage Stage: UnreviewedAccepted

comment:2 by Brian Rosner, 16 years ago

Owner: changed from anonymous to Brian Rosner
Status: assignednew

Whoops, that was me above.

comment:3 by Brian Rosner, 16 years ago

Status: newassigned

comment:4 by Brian Rosner, 16 years ago

Resolution: fixed
Status: assignedclosed

(In [7943]) newforms-admin: Fixed #7790 -- Check form fields, not model fields when testing for field existence in fields and fieldsets. Thanks Rozza for catching this and writing an initial patch.

post-commit mishap ;)

comment:5 by Jacob, 12 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

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