On Aug 12, 9:22 am, aa56280 <[email protected]> wrote:
> I'm using the url tag like so: {% url app.views.blah var1, var2 %}
>
> var1 and var2 need to be encoded, using the iriencode filter, so I
> tried this: {% url app.views.blah var1|iriencode, var2|iriencode %}
>
> That doesn't do anything though. I can't find any examples anywhere to
> figure this out. Any thoughts?
Does the view code in app.views.blah know what to do with the
iriencode'd values?
Remember there are two ways to generate URLs in your templates -
either with the {% url ... %} tag as you're doing now or with a
get_absolute_url() method on the model (you then refer to <a
href="{{ instancename.get_absolute_url }}"> in your template).
By using the latter approach, you can write whatever custom python you
need in the model method.
http://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#get-absolute-url
./s
--
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.