You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to glashammer
In django, inside templates, i can recover a shortcut to a url with
the tag {%url shortcut %}. With glashammer, how can i do that? I
wouldn't like to hardcode any urls inside the templates.
Ali Afshar
unread,
May 7, 2009, 8:41:17 PM5/7/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to glash...@googlegroups.com
There is a function automatically added to the Glashammer template environment called url_for, it takes an endpoint with optional keyword arguments for the rule, and returns a generated URL. For example:
{{ url_for('tag/list', tag_name='python') }}
Which might correspond to the url rule:
'/tag/<string:tag_name>'
Incidentally, you can use this function just as well in normal Python code:
from glashammer.utils import url_for
Ali
Italo Maia
unread,
May 9, 2009, 4:37:03 PM5/9/09
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message