#9315: Keyword arguments with spaces and the url tag
-----------------------------+----------------------------------------------
Reporter: alexisbellido | Owner: nobody
Status: new | Milestone:
Component: Template system | Version: 1.0
Keywords: url | Stage: Unreviewed
Has_patch: 0 |
-----------------------------+----------------------------------------------
Hi, I asked about this on the django-users group and was told it was
probably a bug so I'm reporting it:
I was testing named url patterns and I have something like this in my
URLConf:
{{{
url(r'^search/(?P<words>.*)$', 'books.views.search', name='search_page'),
}}}
The view is defined like this:
{{{
def search(request, words):
}}}
Now I'd like to print a link to the search page with certain words from a
template and used the url tag like this:
{{{
<p>{% url search_page words="someword" %}</p>
}}}
When viewing on the browser I get something like '/search/someword', which
is good. My question is how do I pass more than one word in the 'words'
parameter?
If I do this:
{{{
<p>{% url search_page words="someword otherword" %}</p>
}}}
I get this error:
{{{
TemplateSyntaxError at (my page name here)
Could not parse the remainder: '"someword' from '"someword
}}}
Can the url tag handle parameters with spaces?
--
Ticket URL: <http://code.djangoproject.com/ticket/9315>
Django <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
-~----------~----~----~----~------~----~------~--~---