#9880 closed (invalid)
Spaces in assignment of values of named parameters for 'url' template function raise 'TypeError'
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Uncategorized | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When '=' sign in statement like this:
{% url vj job_id=job.id %}
is surrounded by spaces, ie.
{% url vj job_id = job.id %}, view raises TypeError:
Change History (3)
comment:1 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:3 by , 16 years ago
Because of the way Django's template system works, spaces are taken to be separators between arguments. Remember: things you type into templates are not directly interpreted as Python code, and the template language has its own, different-from-Python, ideas about what is and is not acceptable syntax.
Note:
See TracTickets
for help on using tickets.
Which is why the documentation shows you to do it without spaces.