0
0
mirror of https://github.com/django/django.git synced 2024-11-30 07:06:18 +01:00

Corrected slugify()'s docstring.

This commit is contained in:
David Smith 2020-05-29 06:41:17 +02:00 committed by Mariusz Felisiak
parent dde05e192c
commit 3111b434e7

View File

@ -393,9 +393,10 @@ def unescape_string_literal(s):
@keep_lazy_text @keep_lazy_text
def slugify(value, allow_unicode=False): def slugify(value, allow_unicode=False):
""" """
Convert to ASCII if 'allow_unicode' is False. Convert spaces to hyphens. Convert to ASCII if 'allow_unicode' is False. Convert spaces or repeated
Remove characters that aren't alphanumerics, underscores, or hyphens. dashes to single dashes. Remove characters that aren't alphanumerics,
Convert to lowercase. Also strip leading and trailing whitespace. underscores, or hyphens. Convert to lowercase. Also strip leading and
trailing whitespace.
""" """
value = str(value) value = str(value)
if allow_unicode: if allow_unicode: