#7917 closed (invalid)
Decide whether {% url %} syntax changes
Reported by: | Johannes Dollinger | Owned by: | nobody |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | ||
Cc: | justinlilly@…, Trevor Caira | Triage Stage: | Design decision needed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Doc quote: "Note that the syntax for this tag may change in the future, as we make it more robust."
Recent django-dev thread: http://groups.google.com/group/django-developers/browse_thread/thread/fd30cb20f80c6c79
Options:
- Make the view name a normal
Variable
. Backwards incompatible: old{% url foo %}
vs new{% url "foo" %}
- Accept a quoted view name, deprecate unquoted view names. Backwards compatible. This would enable a soft transition to solution 1.
- Treat an unquoted view name as a literal, unless
reverse
fails. Then try to treat it as a Variable. Backwards incompatible (strange things might happen). Proposed here: http://groups.google.com/group/django-developers/browse_thread/thread/31ed4b3bbebbb2af/. - ???
- Do nothing.
Attachments (1)
Change History (11)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Cc: | added |
---|
comment:4 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:5 by , 16 years ago
Adrian, Jakob, the powers that be, I call you!
Unless you have a strong opinion to leave everything as is, {% url %}
syntax should change.
comment:6 by , 16 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
In light of the recent acceptance of #9666 I think this ticket should be reconsidered as well.
If it is acceptable to "silently" modify the SSI tag to try context variable resolution first I think this change is much the same. Even the patch would be nearly identical.
Being able to use a context variable has many uses (e.g. in a generic pagination tag wich could take the view name as a parameter).
comment:7 by , 16 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
If you disagree with a decision that has been made by a core developer, don't just re-open the ticket - you need to start a discussion on django-developers.
comment:8 by , 16 years ago
Has patch: | set |
---|---|
milestone: | 1.0 beta → 1.1 |
I added a patch that seems to do the trick. From what I can tell, this doesn't break anything since literal strings, quoted strings and context variables all evaluate correctly using Variable().
comment:9 by , 16 years ago
This ticket has already been closed by a core developer, barring a chance in their decision it will not be included in Django.
Let's just leave this as a mailing list thread, since that's the resolution of the ticket. A decision has been made and the current thread is only saying some people want to go over it again. No new convincing arguments have been made. As mentioned in the most recent thread, this has been discussed on django-dev at least twice before and both times the resolution has been "no change". So that's where it stays for now. Unless you can get Adrian or Jacob to have a strong opinion to change it now, nothing will happen.