#3512: [patch] Add HTML classes to fields in newforms as_methods: "required" &
"error"
-------------------------------------------------+--------------------------
Reporter: Waylan Limberg <[EMAIL PROTECTED]> | Owner:
adrian
Status: new | Component:
django.newforms
Version: SVN | Resolution:
Keywords: | Stage:
Design decision needed
Has_patch: 1 | Needs_docs: 1
Needs_tests: 1 | Needs_better_patch: 0
-------------------------------------------------+--------------------------
Comment (by [EMAIL PROTECTED]):
Because with 3512 I can set styles on the label or the actual form input
at will with "label .required" and "input .required" for example. With
3515 the only way to set a style on the label tag is by traversing the
DOM, since only the input control got the CSS class set.
With this patch you CAN set css styles on a per form basis, just not in
the model. As long as you on the form tag itself put an ID, you can
individually control the styling of any item in the form with the CSS
selector, for example: "#id_my_poll_form #id_title label { background:
yellow; }" This will only set the color of labels inside items with the id
"id_title" that are in turn inside a form "id_my_poll_form". This prevents
unreasonable leakage across the MVC layers, unlike 3515 where I have to
set CSS classes in the model where they really don't belong.
--
Ticket URL: <http://code.djangoproject.com/ticket/3512#comment:7>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---