List Info

Thread: How to pass a variable as parameter to a tag




How to pass a variable as parameter to a tag
user name
2006-02-15 07:52:28
On 2/15/06, Ian Holsman <krytongmail.com> wrote:
>
> doesn't something like:
> class TopTagsNodeUser(template.Node):
>     """ what is the root of this
application """
>     def render(self, context):
>         user = context.get('user', None)
>         if user.is_anonymous():
>             return ""
>         return "<div
class='panel'><h4>User
Prefs</h4><ul><li>"+str(user)+"
;</li>
> </ul></div>"
>
> work?
>

I think it can work. But this appoach skips parameter.

I'll use it for now. Thanks.

--
I like python!
My Blog: http://www.donews.net/l
imodou
NewEdit Maillist: http://groups.
google.com/group/NewEdit
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )