Changes between Initial Version and Version 1 of Ticket #26234, comment 2


Ignore:
Timestamp:
Feb 18, 2016, 9:03:29 AM (9 years ago)
Author:
Will Stott

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26234, comment 2

    initial v1  
     1Replying to [comment:1 timgraham]:
     2> I'm concerned that adding this could open a can worms of customization parameters for the `as_*()` methods which I think are really meant as simple shortcuts when very little customization is needed .
     3
    14I understand why you're concerned. I would justify this by saying that the patch only modifies the actual tag specified in the method name. As the method is already a direct reference to that html tag, any customisation would be logically kept to the tag which that function adds (surely '''never''' more than `attrs={}`).
    25
     
    811I just feel the .as_* methods are almost useless without ''some'' customisation. And it feels natural for me to do `form.as_p('large')` or the like with that method.
    912
     13> I'm inclined to say you should do this with a Python mixin:
     14
    1015Your particular snippet adds classes to the ''widget'', not the form container (i.e. also encompassing the <label>).
    1116
Back to Top