Opened 17 years ago
Last modified 16 years ago
#7021 closed
url templatetag not working when used with two words (invalid?) — at Version 2
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | Keywords: | slug model url template | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When i enter "Two Words" in admin and get them converted to a slug, they're converted to "two-words".
However, when i enter {% url page "two-words" %} in my template to get a permalink to that page, link is not generated at all. If i change "-" to "_" by hand, everything works just fine.
(Removing the milestone until the bug is confirmed)
Change History (2)
comment:1 by , 16 years ago
Component: | django-admin.py → Template system |
---|---|
milestone: | → 1.0 |
Summary: | slug bug → url templatetag not working when used with two words (invalid?) |
comment:2 by , 16 years ago
Description: | modified (diff) |
---|---|
milestone: | 1.0 |
Replying to manta@idev.lt:
However, when i enter {% url page "two-words" %} in my template to get a permalink to that page, link is not generated at all. If i change "-" to "_" by hand, everything works just fine.
Uhm, could you post the urls.py line that the url should resolve to? It's possible that your regex is not perfect and does not match "-" as a valid character.
Actually I think that the problem here is a misunderstanding of url templatetag usage, that as far as I know is used for converting views to urls, not pages and slugs.
Check http://www.djangoproject.com/documentation/templates/#url and close as invalid if you think that this is not a correct bug report.