Django

Code

Ticket #7790 (closed: fixed)

Opened 5 months ago

Last modified 5 months ago

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

Reported by: Rozza Assigned to: brosner
Milestone: 1.0 alpha Component: django.contrib.admin
Version: newforms-admin Keywords: nfa-blocker
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

validation.py.patch (2.3 kB) - added by Rozza on 07/17/08 05:20:07.
Patch to validation.py and added test cases to modeladmin/models.py

Change History

07/17/08 05:20:07 changed by Rozza

  • attachment validation.py.patch added.

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

07/17/08 08:37:26 changed by anonymous

  • status changed from new to assigned.
  • needs_better_patch changed.
  • needs_tests changed.
  • owner changed from nobody to anonymous.
  • keywords changed from BLOCKER newforms admin validation to nfa-blocker.
  • needs_docs changed.
  • stage changed from Unreviewed to Accepted.

07/17/08 08:37:55 changed by brosner

  • owner changed from anonymous to brosner.
  • status changed from assigned to new.

Whoops, that was me above.

07/17/08 08:38:01 changed by brosner

  • status changed from new to assigned.

07/17/08 11:51:36 changed by brosner

  • status changed from assigned to closed.
  • resolution set to fixed.

(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 ;)


Add/Change #7790 (New validator for ModelAdmin classes should use explicitly declared forms for validation if appropriate)




Change Properties
Action