On Tue, 2008-07-01 at 23:01 -0700, Yosifov Pavel wrote:
>
>
> On 2 июл, 10:54, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> > On Tue, 2008-07-01 at 20:44 -0700, Yosifov Pavel wrote:
> > > I made own tags. Sometimes I want to "rendering" arguments (when
> > > arguments of the tag are Django-template-expressions). So, I use
> > > template.render() method. All is OK but it's look like this:
> >
> > > {% some_tag {{var}} %}
> >
> > You can put whatever you want into your own custom tags, but this won't
> > work for normal Django tags.
>
> So, I can not use common syntax for arguments of built-in tags?
> Something like {{var|default:......}} ?
That's not a tag. "{% ... %}" is a tag. "{{...}}" displays a variable
(possibly after passing it through some filters. I'm not sure if that's
the source of your confusion here. I don't really understand the rest of
your questions.
The Django documentation (particularly templates.txt) give quite a lot
of examples of using both template tags and filters that show how it's
done.
> Django's templates doesnt support this? Yes?
> But I can do it in own tags because of using rendering of {{var|
> default:....} as mini template. Right?
> So, resume: tag arguments in built-in tags and own tags are not
> symmetric: in own tags they are more flexible...
In your own tags, you can parse the contents however you like, was all I
meant (have a look at any tag code and you'll see that it parses the
contents initially -- you can insert whatever code you like there). I
certainly wouldn't recommend it, however. It's not required for
functionality purposes.
Regards,
Malcolm
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---