#7803: Peter
------------------------------+---------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: SVN
Keywords: url | Stage: Unreviewed
Has_patch: 0 |
------------------------------+---------------------------------------------
about <% url foo bar %> template tag.
when 'url' tag reverse url, arguments can't be sended properly in case
below.
aggument that there is in views but not in url is CAN NOT SENDED from url
template tag.
(examples)
<views.py>
def ticket(request, next=None):
context = {"next": next}
return render_to_response("ticket.html", context)
<ticket.html>
next={{ next }}
'''CASE 1:'''
RESULT is VALID case.
<urls.py>
url(r'^ticket/$', 'my.test.views.ticket', {'next': 100},
name='test_ticket')
<caller.html>
<a href="{% url my.test.views.ticket %}">next ticket</a>
or <a href="{% url test_ticket %}">next ticket</a>
<result of ticket.html>
next=100
'''CASE 2:'''
RESULT is INVALID case.
<urls.py>
url(r'^ticket/$', 'my.test.views.ticket', name='test_ticket')
<caller.html>
<a href="{% url my.test.views.ticket next=100 %}">next ticket</a>
or <a href="{% url test_ticket next=100 %}">next ticket</a>
<result of ticket.html>
next=None
'''CASE 3:'''
RESULT is VALID case. But, 'next' in url is dummy.
<urls.py>
url(r'^ticket/(?P<next>.*)/$', 'my.test.views.ticket',
name='test_ticket')
<caller.html>
<a href="{% url my.test.views.ticket next=100 %}">next ticket</a>
or <a href="{% url test_ticket next=100 %}">next ticket</a>
<result of ticket.html>
next=100
--
Ticket URL: <http://code.djangoproject.com/ticket/7803>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" 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-updates?hl=en
-~----------~----~----~----~------~----~------~--~---