> On Feb 10, 2014, at 12:16 PM, Carl Meyer <c...@oddbird.net> wrote:
> 
> It's a problem that we are unable to do things
> that would otherwise be no-brainers (e.g. rendering form widgets using
> templates rather than by concatenating strings of HTML in Python code)
> because our default templating language is too slow.

The deliberate hobbling aspect also makes situations like this that should be 
no-brainers into painful slogs. Form widgets are a great example beyond this, 
too, because customizing HTML for particular form elements (e.g. adding 
size="30" to one input field) is an absolute pain. The blessed way involves 
overwriting the field, which requires copying every single relevant attribute 
of the model (and then double-maintaining changes).

The Flask extension's mechanism is {{ field(size=30) }}. Done.

And under this example, it's DTL that pushes you to put that logic in the wrong 
place; it doesn't belong in a forms.py file in most places. I've even seen 
cases where the only reason an explicit form exists is to make small 
template-level changes.

Best Regards,
Luke

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/D995D550-BE4B-4B76-9DBD-3C01992DA067%40sneeringer.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to