Re: ModelForm using Model error_messages

Skip to first unread message

Loic Bistuer

Mar 11, 2013, 12:52:03 PM3/11/13
This is more or less the idea behind except that the custom error_messages would be defined in ModelForm rather than Model. In my opinion, Model is a terrible place to define user-facing strings such as help_text or error_messages, at best useful to supply default values.

From a quick glance at the code, we might need some special handling to override the error_messages defined in model fields. I would tackle that if #20000 were to be accepted.

I'll write more thoroughly about #20000 once the discussion about Bruno's proposal (ref. #12915) has settled.


On Mar 11, 2013, at 8:50 PM, Nicolas Diaz Aragon <> wrote:

If the 'error_messages' attribute were also included, then there'd be just one place to define all your error messages: the model. This makes cleaner code, because you know there's only one way to look for error messages.

Reply all
Reply to author
0 new messages