Opened 9 years ago

Closed 9 years ago

#6790 closed (wontfix)

Changes to form.errors adressing #6705 and #6138

Reported by: oyvind Owned by: nobody
Component: Forms Version: master
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: UI/UX:

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

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by oyvind

comment:1 Changed 9 years ago by oyvind

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

Changed 9 years ago by oyvind

no need for force_unicode and escape

comment:2 Changed 9 years ago by Chris Beaven

Needs tests: set
Triage Stage: UnreviewedAccepted

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

comment:3 Changed 9 years ago by Chris Beaven

Keywords: easy-pickings added

The easy picking is adding tests. Go!

Changed 9 years ago by oyvind

Removed some code duplication one form.errors.get

Changed 9 years ago by oyvind

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

comment:4 Changed 9 years ago by oyvind

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

Should make this a new ticket.

comment:5 Changed 9 years ago by Chris Beaven

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 Changed 9 years ago by oyvind

Resolution: wontfix
Status: newclosed

removed in favor or rendering errors via filters

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