Opened 13 days ago

Last modified 13 days ago

#28788 new New feature

Add support for Model.clean_<fieldname>

Reported by: Jonas Haag Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Form.clean_<fieldname> should have an equivalent in models, Model.clean_<fieldname>.

I've implemented a proof of concept here: https://github.com/django/django/pull/9336

I'm not sure about backwards compatibility; we certainly don't want surprising calls to model methods that are called clean_XXX by coincidence.

Change History (1)

comment:1 Changed 13 days ago by Tim Graham

Triage Stage: UnreviewedSomeday/Maybe

At first glance, my thought is "why duplicate the field validators API"? A consensus on the DevelopersMailingList to make this change is needed.

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