hi all

I have a lot of small pieces of template like

<a href="{{object.get_absolute_url}}">object.name</a>

and I need to inset these pieces here and there. I can define
inclusion_tag for every piece, but their definitions look stupidly the
same:

def object(a):
    return {'a': a}
object = register.inclusion_tag('object.html')(object)

only object differs, so it is not the best solution. I tried to use {%
include %} tag, but in different templates I need to refer to "object"
by different names. let's say in template parent.html "object" called
"childObject", in template child.html "parentObject", so I need kind
of aliasing/mapping of variable names or variable assignment in
template. currently I'm thinking about extension {% include %} tag for
accepting third argument (for mapping) or custom tag like {% let
object childObject %}. maybe there is better or standard approach
exist for this?

thanks
Maxim Loginov
http://zeliboba.by.ru


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to