Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#9880 closed (invalid)

Spaces in assignment of values of named parameters for 'url' template function raise 'TypeError'

Reported by: Art Skvira <artem.skvira@…> 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


When '=' sign in statement like this:

{% url vj %}

is surrounded by spaces, ie.

{% url vj job_id = %}, view raises TypeError:

Change History (3)

comment:1 Changed 10 years ago by James Bennett

Resolution: invalid
Status: newclosed

Which is why the documentation shows you to do it without spaces.

comment:2 Changed 10 years ago by Art Skvira <artem.skvira@…>

But why formatting style has to be enforced in such way?

comment:3 Changed 10 years ago by James Bennett

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.
Back to Top