#700 closed defect (invalid)
urlify.js and slugify use different character for spaces
Reported by: | Alastair Tse | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | major | Keywords: | |
Cc: | alastair@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When a model has a SlugField and prepopulate is turned on, the javascript from urlify.js in the admin interface will use underscores to replace spaces and the defafult template filter slugify will use hyphens. I suggest that the slugify in the template filters use underscores to be consistent with what happens with the admin interface.
Change History (7)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
priority: | low → normal |
---|
Most definitely use hyphens. Especially since that's what #317 already changed (just urlify.js wasn't changed).
comment:3 by , 19 years ago
No problems with that, then its only a one character fix in urlify.js :) I didn't know that underscores were google-unfriendly though.
comment:4 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 19 years ago
Component: | Admin interface → Core framework |
---|---|
Resolution: | fixed |
Severity: | minor → major |
Status: | closed → reopened |
This patch breaks Django with MySQL backend (maybe other backends are affected as well). I am getting 404 for all new slugs. I checked databases and everything looks o.k. I suspect that it is related to unquoted slugs (see #121) --- before slugs were words, now they are arithmetic expressions. :)
comment:6 by , 19 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
If you're getting 404s, you'll probably want to alter your URLconfs so that they catch hyphens instead of just "\w" (alphanumerics + underscores).
comment:7 by , 19 years ago
Error code: 404, response time: 5 minutes, code change: 3 characters, results: priceless. There is one thing money can't buy --- true personal experience. :)
Please, don't use underscores. They are not google-friendly. Instead fix the javascript to use hyphens.