Opened 17 years ago
Closed 13 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: | dev |
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)
Change History (7)
by , 17 years ago
Attachment: | forms-error-messages.patch added |
---|
comment:1 by , 17 years ago
Needs documentation: | set |
---|---|
Needs tests: | set |
comment:2 by , 17 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:3 by , 16 years ago
Cc: | added |
---|
comment:4 by , 14 years ago
Type: | → New feature |
---|
comment:5 by , 14 years ago
Severity: | → Normal |
---|
comment:6 by , 13 years ago
Easy pickings: | unset |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
UI/UX: | unset |
Note:
See TracTickets
for help on using tickets.
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.