Opened 9 years ago

Closed 5 years ago

#6737 closed New feature (wontfix)

Add Field default_error_messages feature to Forms class

Reported by: nicklane Owned by: nobody
Component: Forms Version: master
Severity: Normal Keywords:
Cc: daemondazz Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I found it was useful to have the same default_error_messages dict feature that exists in Field classes, with Form classes too. This allows you to easily override the error messages shown by form validation, or change the messages by subclassing.

Attachments (1)

forms-error-messages.patch (3.4 KB) - added by nicklane 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by nicklane

Attachment: forms-error-messages.patch added

comment:1 Changed 9 years ago by nicklane

Needs documentation: set
Needs tests: set

comment:2 Changed 9 years ago by Jacob

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 8 years ago by daemondazz

Cc: daemondazz added

comment:4 Changed 6 years ago by Julien Phalip

Type: New feature

comment:5 Changed 6 years ago by Julien Phalip

Severity: Normal

comment:6 Changed 5 years ago by Carl Meyer

Easy pickings: unset
Resolution: wontfix
Status: newclosed
UI/UX: unset

Fields use a default_error_messages dict because they are built-in Django code that raises errors, and its useful for users to have a sane way to customize those messages.

Django's built-in Form classes don't raise any errors themselves. User forms that raise errors can use whatever technique they want for allowing subclasses to easily modify their error messages; Django doesn't need to dictate a particular method.

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