On Tue, Feb 11, 2014 at 9:31 AM, Luke Sneeringer <[email protected]>wrote:
> On Feb 10, 2014, at 12:16 PM, Carl Meyer <[email protected]> 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. > Please don't fall into the trap of assuming I'm mentally impaired in some way. I've been using the Django template language for a long time. I'm aware of what you can and can't do. I'm fully aware of syntactic sugar that Jinja2 provides, and the ways that it can be used. I'm also aware of the ways it can be abused. I'd be able to mount a reasonable argument that {{ field(size=30) }} is a problem, not a feature (whats the magical significance of 30? What happens if you make a site-wide decision to extend all size=30 fields to size=40? etc. And, to be clear, I'm not interested in having *this* specific argument in long form. Just be aware that I'd make it, and that it's the argument that underpins the original design decisions of Django's template language). In the light of this full awareness, *my* analysis has concluded that I'm willing to live with a little inconvenience, and gain an ecosystem in which newcomers aren't encouraged to turn their templates into PHP. I'm also aware that this is *my* analysis, and that others will come to a different conclusion, based on their own values, priorities, experiences, and engineering taste. This doesn't make *either* analysis wrong. It means different people value different things. Yours, Russ Magee %-) -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CAJxq84-d9eQwz4nJ-E1oHK3WsQhXq1WE2C4r3yjh%3DFq7kMO_4w%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.
