Opened 16 years ago

Closed 16 years ago

Last modified 16 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

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:

http://dpaste.com/100225/

Change History (3)

comment:1 by James Bennett, 16 years ago

Resolution: invalid
Status: newclosed

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

comment:2 by Art Skvira <artem.skvira@…>, 16 years ago

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

comment:3 by James Bennett, 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.
Back to Top