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 the
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 then will be evaluated with a context:
def do_calendar(parser, t
februari 2006 11:10
To: django-users@googlegroups.com
Subject: Re: How to pass a variable as parameter to a tag
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 p
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 {{object.
jango-users@googlegroups.com
Subject: Re: How to pass a variable as parameter to a tag
On 2/15/06, Ian Holsman <[EMAIL PROTECTED]> wrote:
>
> doesn't something like:
> class TopTagsNodeUser(template.Node):
> """ what is the root of this application "&q
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():
> retu
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 2/15/06,
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 wor
8 matches
Mail list logo