#287 closed defect (fixed)
slugify description incorrect
Reported by: | Owned by: | Jacob | |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | minor | 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
The documentation for sluguify says it removes "non-alpha" characters. It actually removes non-word characters, according to the PCRE definition of "word" (alphanumeric plus underscore). I confirmed this by looking at the source for slugify. The docs should be updated to note what slugify actually does. It seems rational to allow numbers in slugs, so this is not a suggestion to change the behavior of the function.
You may also want to note in the documentation that slugify strips leading and trailing whitespace. It's not likely to affect anyone, but it could be important for somebody.
I've added a custom SlugField to my Django, and I've talked about this stuff with jacobkm. We agreed that it would be nice to have some options to the SlugField to customize how exactly it's built.