The simple fix would be to tweak our current jinjasupport module to add
this reverse function on the environment globals, however I still need
to test if the arguments passing will work or not…
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: New
Bug description:
Django has this nice feature of naming url patterns: http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 that is great in order to avoid hardcoding URLs in the models or in the templates.
However, sice we have chosen to replace the default template engine with Jinja2, we miss the nice {% url %} tag too :(
So, this bug is for implementing a global Jinja function we can call that works simillarly, wich means: given an url name and some arguments, it must print the related relative url based on the configured urlpatterns.
Django has this nice feature of naming url patterns:
http://docs.djangoproject.com/en/dev/topics/http/urls/#id2 that is great
in order to avoid hardcoding URLs in the models or in the templates.
However, sice we have chosen to replace the default template engine with
Jinja2, we miss the nice {% url %} tag too :(
So, this bug is for implementing a global Jinja function we can call
that works simillarly, wich means: given an url name and some arguments,
it must print the related relative url based on the configured
urlpatterns.
** Affects: publicvideos
Importance: Undecided
Status: New
** Tags: django+jinja jinja jinja2 templates urlpattern
{{ reverse('test_url', args=['1234']) }}
I will commit the fix that implements this, but we may reopen and
revisit this bug with a better solution in the future
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: In Progress
** Changed in: publicvideos
Milestone: None => alpha-launch
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: In Progress
** Changed in: publicvideos
Status: In Progress => Fix Committed
** Changed in: publicvideos
Assignee: (unassigned) => Fabricio Campos Zuardi (fabricio)
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: Fix Committed
example (urls):
urlpatterns = patterns('',
url(r'^$', 'videos.views.index', name="site_index_url"),
…
example (views):
…
return render_to_response("videos/index.html", {'query_text':query_text,'thumbs':thumbs})
example (template):
…
{{ url('site_index_url') }}
…
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: Fix Committed
--
We need an equivalent of django's {% url name arguments %} shortcut to named URLs that works on Jinja templates
https://bugs.launchpad.net/bugs/409678
You received this bug notification because you are a member of
Publicvideos Dev Team, which is the registrant for Public Videos.
Status in Public Videos: Fix Committed