#9079: Label tag attributes
---------------------------------+------------------------------------------
          Reporter:  oggy        |         Owner:  nobody              
            Status:  new         |     Milestone:                      
         Component:  Forms       |       Version:  1.0                 
        Resolution:              |      Keywords:  form label label_tag
             Stage:  Unreviewed  |     Has_patch:  1                   
        Needs_docs:  0           |   Needs_tests:  0                   
Needs_better_patch:  0           |  
---------------------------------+------------------------------------------
Comment (by oggy):

 I gave a more detailed rationale for this in this django-dev post:

 [http://groups.google.com/group/django-developers/t/ead13c9424b279a2]

 As always, there are some other takes on the issue there. Anyhow here's
 the crux of my argument:
    * there's currently no provision for adding any attributes to
 automatically generated label tags. This includes, but is not limited to
 the "class" attribute - other attributes are useful as well (e.g. how do
 you initially completely hide a sometimes-necessary AJAX field otherwise -
 along with its label?)
    * conceptually, I agree that this shouldn't go there as we should let
 the designers have full control of the presentation. However, in order for
 the form to function at all, the programmer needs to select a widget,
 relinquishing designers' control of the design to begin with. In order not
 to lose the control completely, you end up needing to add "attrs" to the
 Widget constructor. Let's be consistent and do the same for the label -
 it's not creating a bigger wart than the one that already exists, and it's
 IMHO pretty convenient as well.
    * it's certainly no more crufty than admin.helpers.AdminField

 Somewhat related to this, BoundField.label_tag currently accepts an attrs
 parameter but that's not used anywhere in the code. Is it a remnant of
 some similar idea that never caught on?

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9079#comment:2>
Django <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
-~----------~----~----~----~------~----~------~--~---

Reply via email to