Opened 17 years ago

Closed 17 years ago

#6790 closed (wontfix)

Changes to form.errors adressing #6705 and #6138

Reported by: oyvind Owned by: nobody
Component: Forms Version: dev
Severity: Keywords: override error_list error_dict show labels errors
Cc: oyvind.saltvik@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Make it possible to override error_dict.

Makes sure all parts uses the overridden error_list and error_class.

{{ form.errors }} now shows label instead of key if it exists in as_ul and as_text

Attachments (4)

error_dict_list_fixes_and_overrides.diff (7.2 KB ) - added by oyvind 17 years ago.
error_dict_list_fixes_and_overrides_2.diff (7.2 KB ) - added by oyvind 17 years ago.
no need for force_unicode and escape
error_dict_list_fixes_and_overrides_3.diff (7.1 KB ) - added by oyvind 17 years ago.
Removed some code duplication one form.errors.get
error_dict_list_fixes_and_overrides_4.diff (6.5 KB ) - added by oyvind 17 years ago.
Fix one thing at the time, just overrides and no labels in errordict

Download all attachments as: .zip

Change History (10)

by oyvind, 17 years ago

no need for force_unicode and escape

comment:2 by Chris Beaven, 17 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

Note, this is backwards incompatible (error_class attribute becomes error_list)

comment:3 by Chris Beaven, 17 years ago

Keywords: easy-pickings added

The easy picking is adding tests. Go!

by oyvind, 17 years ago

Removed some code duplication one form.errors.get

by oyvind, 17 years ago

Fix one thing at the time, just overrides and no labels in errordict

comment:4 by oyvind, 17 years ago

Labels in ErrorDict should be solved better, perhaps a name-to-label dictionary passed to ErrorDict.

Should make this a new ticket.

comment:5 by Chris Beaven, 17 years ago

Keywords: easy-pickings removed
Needs tests: unset
Triage Stage: AcceptedDesign decision needed

Note that this is still backwards incompatible (maybe in a more confusing way), error_class was previously expected to be an ErrorList, now it should be an ErrorDict.

The tests are good enough now, since we aren't introducing new functionality (just modifying it).

Thinking more about this, tt should probably go back for a design decision, so I'll push it back there now.

comment:6 by oyvind, 17 years ago

Resolution: wontfix
Status: newclosed

removed in favor or rendering errors via filters

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