Changes between Initial Version and Version 1 of Ticket #26234, comment 2
- Timestamp:
- Feb 18, 2016, 9:03:29 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26234, comment 2
initial v1 1 Replying 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 1 4 I 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={}`). 2 5 … … 8 11 I 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. 9 12 13 > I'm inclined to say you should do this with a Python mixin: 14 10 15 Your particular snippet adds classes to the ''widget'', not the form container (i.e. also encompassing the <label>). 11 16