Django

Code

Ticket #700 (closed: invalid)

Opened 3 years ago

Last modified 2 years ago

urlify.js and slugify use different character for spaces

Reported by: Alastair Tse Assigned to: adrian
Milestone: Component: Core framework
Version: Keywords:
Cc: alastair@tse.id.au Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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.

Attachments

Change History

10/27/05 03:28:00 changed by Sune Kirkeby <sune.kirkeby@gmail.com>

Please, don't use underscores. They are not google-friendly. Instead fix the javascript to use hyphens.

10/27/05 04:18:39 changed by hugo

  • priority changed from low to normal.

Most definitely use hyphens. Especially since that's what #317 already changed (just urlify.js wasn't changed).

10/27/05 08:57:49 changed by Alastair Tse

No problems with that, then its only a one character fix in urlify.js :) I didn't know that underscores were google-unfriendly though.

10/27/05 22:41:40 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [1017]) Fixed #700 -- urlify.js now uses hyphens instead of underscores

10/30/05 22:06:59 changed by eugene@lazutkin.com

  • status changed from closed to reopened.
  • resolution deleted.
  • component changed from Admin interface to Core framework.
  • severity changed from minor to major.

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. :)

10/30/05 22:12:29 changed by adrian

  • status changed from reopened to closed.
  • resolution set to invalid.

If you're getting 404s, you'll probably want to alter your URLconfs so that they catch hyphens instead of just "\w" (alphanumerics + underscores).

10/30/05 22:23:51 changed by eugene@lazutkin.com

Error code: 404, response time: 5 minutes, code change: 3 characters, results: priceless. There is one thing money can't buy --- true personal experience. :)


Add/Change #700 (urlify.js and slugify use different character for spaces)




Change Properties
Action