On Sep 28, 6:57 pm, Rob Hudson <treborhud...@gmail.com> wrote: > For lack of knowing about anything better, I keep falling back to > Werkzeug's HTMLBuilder class[1]. Pulled out and stripped of comments, > it weighs in at 77 lines of code...
That's not so bad. I was worried about pulling in a large dependency, but 77 lines (probably dropped in to django.utils.builder or similar) isn't particularly alarming. I'm still a bit sceptical of introducing another markup abstraction just to solve this one problem. I wonder if it could be used to tackle the RSS/Atom generation problem as well? > I agree with what I think I'm reading here -- a goal being to give > designers more fine grained control over the form and form elements at > the template level. Yes, that's exactly it. Designers should be able to do anything they like with forms at the template level (hence the {% field form.name class="foo" %} suggestion). Again, this makes me slightly cautious about the HTMLBuilder approach since exposing that at the template level is virtually impossible. > I think you might want both 1 and 3. (1) for those that want finer > control or just don't want to use the underlying HTML wrapper, and (3) > for those that do. > > Would it be something to consider adding special case tag, like > comments, to represent the self closing slash depending on current > context's doctype? For example, something like {% / %}? I'm really not in favour of 3. 1 I think is OK - as I mentioned above, I added it to django-html as {% slash %} and it's actually not that unpleasant. I think I'd rather avoid adding custom syntax like {% / %} just to support this one tiny edge case (I strongly expect most Django developers won't ever want to write code that's doctype agnostic - and as Max mentioned, HTML5 grandfathers in the /> syntax - the tag will be used strictly by perfectionists). Cheers, Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---