Hi Chris,
On 07/09/2011 02:50 AM, Chris Beaven wrote:
> If we're going to keep things simple, why are we introducing the idea of
> inline "using" templates?
That's a good question. I wouldn't be gutted at all if we dropped
inline-using from the initial scope, too, because I really think
separate template files is not a bad thing. But I'm also not as
concerned about having it in because in my mind it really doesn't have
the complexity downsides of inline-extends; its just a pretty normal
scoped tag, much like "with" or other existing tags.
> You go a long way of convincing me that the confusion introduced by
> 'extends' isn't worth it.
> You're right, my example suited a separate template file just fine. But
> do I really need to create a new template file for all specific cases?
> It seems like the following templates would be much better to just be
> kept inline with the main template the form is being used in.
>
> "forms/p-custom-help-text-for-displayname.html"
> {% extends "forms/p.html" %}
> {% block config %}
> {% formconfig field using
> "checkbox-custom-help-text-for-displayname.html" for form.display_name %}
> {% endblock %}
>
> "forms/fields/checkbox-custom-help-text-for-displayname.html"
> {% extends "forms/fields/checkbox.html" %}
> {% block label %}Show posts by me as from <em>{{ user.username }}</em>
> rather than <em>{{ user.get_full_name }}</em>{% endblock %}
>
> Perhaps I'm not quite getting how we'd do this kind of thing with the
> current proposal.
The only issue I see here is naming :-) When a template gets that
specific in purpose, it doesn't make sense to pretend its reusable and
try to name it in a "generic" way. In general I don't see any problem
with making specific included form templates for specific needs. I'd
probably just call these "profile_form.html" and "display_name.html", if
those are names that make sense in the context of the project. I don't
know about your projects, but mine already include plenty of template
partials with very project-specific, non-generic purposes, so I don't
see this as that different.
Carl
--
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en.