Opened 15 years ago

Closed 10 years ago

#12437 closed New feature (fixed)

error_css_class should not override existing classes in html

Reported by: anonymous Owned by: Markus Amalthea Magnuson
Component: Forms Version:
Severity: Normal Keywords: forms, errors
Cc: markus.magnuson@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

There is no possibility for now to show html row with custom class + error_css_class

For example i want to do something like this

normal_row = u'<div class="js-active forms__width %(html_class_attr)s">......'

because %(html_class_attr)s return string with html attribute itself, not just class name.

The solution i think is just to return css class name.

Change History (7)

comment:1 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted
Version: SVN

We can't remove html_class_attr from the dictionary that is provided, but I can't see any reason we shouldn't expose css_classes for use in templating rows.

comment:2 by Matt McClanahan, 14 years ago

Severity: Normal
Type: New feature

comment:3 by Aymeric Augustin, 13 years ago

UI/UX: unset

Change UI/UX from NULL to False.

comment:4 by Aymeric Augustin, 13 years ago

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:5 by Markus Amalthea Magnuson, 10 years ago

Cc: markus.magnuson@… added
Has patch: set
Owner: changed from nobody to Markus Amalthea Magnuson
Status: newassigned

I've written a patch for this, including tests: https://github.com/django/django/pull/4819

comment:6 by Tim Graham, 10 years ago

Triage Stage: AcceptedReady for checkin

comment:7 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 1884bf8e:

Fixed #12437 -- Added css_classes to Form._html_output()

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