Opened 7 years ago

Closed 6 years ago

#28788 closed New feature (wontfix)

Add support for Model.clean_<fieldname>

Reported by: Jonas Haag Owned by: nobody
Component: Database layer (models, ORM) Version: dev
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 (2)

comment:1 by Tim Graham, 7 years ago

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.

comment:2 by Tim Graham, 6 years ago

Resolution: wontfix
Status: newclosed

The django-developers discussion didn't yield a consensus about this.

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