I'm not opposed to the idea of an inline macro tag, but it doesn't need to 
be core.

Here's how I'd write it (using 
django-ttag<http://packages.python.org/django-ttag/index.html> - untested 
and just off the top of my head)

class Template(ttag.Tag):
    """
    Provides the contents of this tag as a Template available on the 
context.

    {% template user_template %}
    <a href="mailto:user.email";>{{ user.first_name.1 }}. {{ user.last_name 
}}</a>
    {% endtemplate %}

    <p>Owner:<br />{% include user_template with user=company.owner %}</p> 
    <p>Members:{% for user in company.members.all %}<br />{% include 
user_template %}{% endfor %}</p> 

    """
    name = ttag.Arg(positional=True)

    class Meta:
        block = True

    def render(self, context):
        data = self.resolve(context)
        t = template.Template('')
        t.nodelist = self.nodelist
        context[data['name']] = t
        return ""

-- 
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.

Reply via email to