[Django] #23558: document slugify limitations

18 views
Skip to first unread message

Django

unread,
Sep 25, 2014, 10:55:43 PM9/25/14
to django-...@googlegroups.com
#23558: document slugify limitations
-------------------------------+--------------------
Reporter: kmike | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------
Currently slugify docs say:

> slugify Converts to lowercase, removes non-word characters
(alphanumerics and underscores) and converts spaces to hyphens. Also
strips leading and trailing whitespace.

In Python 3:

{{{
>>> 'вася'.isalnum()
>>> True
}}}

but slugify doesn't work like documented for such strings. Isn't it a bug
if something doesn't work as documented?

https://code.djangoproject.com/ticket/8391 was closed as wontfix. If there
is no intention to make slugify work better it should be documented when
it works and when people should find alternative solutions.

--
Ticket URL: <https://code.djangoproject.com/ticket/23558>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 25, 2014, 11:44:03 PM9/25/14
to django-...@googlegroups.com
#23558: document slugify limitations
-------------------------------+--------------------------------------

Reporter: kmike | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by mitar):

* cc: mmitar@… (added)
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:1>

Django

unread,
Sep 28, 2014, 5:03:55 AM9/28/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* type: Uncategorized => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

`s/alphanumerics/ASCII alphanumerics/` should do the job :-)

More seriously, let's take this opportunity to expand a bit the
documentation and point to [https://github.com/mozilla/unicode-slugify/
unicode-slugify] -- which produces unicode slugs, while django produces
ASCII slugs.

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:2>

Django

unread,
Sep 28, 2014, 9:05:53 AM9/28/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by mitar):

You can also point to [https://github.com/mitar/django-
missing/blob/master/missing/templatetags/url_tags.py#L179 slugify2]. ;-)

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:3>

Django

unread,
Oct 12, 2014, 7:24:58 PM10/12/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by dhoffman):

* status: new => assigned
* owner: nobody => dhoffman


--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:4>

Django

unread,
Oct 12, 2014, 8:40:57 PM10/12/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by dhoffman):

* has_patch: 0 => 1


Comment:

Pull request: https://github.com/django/django/pull/3349

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:5>

Django

unread,
Oct 13, 2014, 4:54:19 PM10/13/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by dhoffman):

I created a new pull request based on the feedback to my previous one:
https://github.com/django/django/pull/3357

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:6>

Django

unread,
Oct 13, 2014, 5:30:01 PM10/13/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by SmileyChris):

The problem is, it's not *just* ASCII alphanumerics kept either so the
suggested description is still incorrect:
{{{
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.utils.text import slugify
>>> slugify('Māori')
'maori'
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:7>

Django

unread,
Oct 13, 2014, 6:18:24 PM10/13/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: assigned
Component: Documentation | Version: 1.7

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by dhoffman):

Ah, good point.

I have updated with another pull request:
https://github.com/django/django/pull/3358

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:8>

Django

unread,
Oct 30, 2014, 9:07:58 AM10/30/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"03467368dbd6a427985f86463faa61619f08c833"]:
{{{
#!CommitTicketReference repository=""
revision="03467368dbd6a427985f86463faa61619f08c833"
Fixed #23558 -- documented slugify limitations
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:9>

Django

unread,
Oct 30, 2014, 9:08:18 AM10/30/14
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d9bb7128fe7bc565a2dbbd1e89bb0345711b46f6"]:
{{{
#!CommitTicketReference repository=""
revision="d9bb7128fe7bc565a2dbbd1e89bb0345711b46f6"
[1.7.x] Fixed #23558 -- documented slugify limitations

Backport of 03467368db from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:10>

Django

unread,
Jan 22, 2015, 7:38:24 AM1/22/15
to django-...@googlegroups.com
#23558: document slugify limitations
--------------------------------------+------------------------------------
Reporter: kmike | Owner: dhoffman
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by Haakenlid):

Is this the new documentation?

Converts to ASCII. Converts spaces to hyphens. Removes characters that
aren't alphanumerics, underscores, or hyphens. Converts to lowercase.


Also strips leading and trailing whitespace.

Where can I find out which alphanumerics are deleted, and which
alphanumerics are converted to ASCII?

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:11>

Django

unread,
May 6, 2019, 1:12:44 PM5/6/19
to django-...@googlegroups.com
#23558: document slugify limitations
-------------------------------------+-------------------------------------
Reporter: Mikhail Korobov | Owner: David
Type: | Hoffman
Cleanup/optimization | Status: closed
Component: Documentation | Version: 1.7

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Ülgen Sarıkavak):

Documentation is still misleading, why this issue is closed?

--
Ticket URL: <https://code.djangoproject.com/ticket/23558#comment:12>

Reply all
Reply to author
Forward
0 new messages