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

2006-02-17 Thread limodou
On 2/17/06, Maniac <[EMAIL PROTECTED]> wrote: > > limodou wrote: > > >{% calendar year month %} > > > > > It's perfectly possible (strange I can't find it in the docs now but I > knew it from there). > > In your tag function you should wrap all the parameters in a special > parser object which

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

2006-02-16 Thread limodou
On 2/16/06, Leeuw van der, Tim <[EMAIL PROTECTED]> wrote: > > But isn't the idea that you can use the parameter passed as name of key > to lookup in context? Then you can pass parameter to tag. > This way can only deal with the viariable which exists in context. But how about: {% mytag

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

2006-02-14 Thread limodou
On 2/15/06, Ian Holsman <[EMAIL PROTECTED]> 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(): >

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

2006-02-14 Thread Ian Holsman
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 "User Prefs"+str(user)+" " work? On

How to pass a variable as parameter to a tag

2006-02-14 Thread limodou
Say I have a tag, it could take some parameter, just like: {% calendar 2006 2 %} But in above code, the parameter is a fixed value. But if I have a year and a month variable, and I want to pass them to calender tag, so how to deal with that. It seems that: {% calendar year month %} can not