summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2005-08-10 15:40:14 +0000
committerAdrian Holovaty <adrian@holovaty.com>2005-08-10 15:40:14 +0000
commit254f31819bb47eb23ea4f163154a55e80e2478a9 (patch)
tree9beab63edb913393d13818cc674320238213fb5e
parent151bf05850e1a5449c741aecdaafae544c6bcccf (diff)
Fixed #299 -- Slugify no longer removes hyphens. Thanks, gch@cs.cmu.edu
git-svn-id: http://code.djangoproject.com/svn/django/trunk@464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/core/defaultfilters.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/core/defaultfilters.py b/django/core/defaultfilters.py
index 1ccf07b32e..435f8632a3 100644
--- a/django/core/defaultfilters.py
+++ b/django/core/defaultfilters.py
@@ -54,15 +54,15 @@ def make_list(value, _):
def slugify(value, _):
"Converts to lowercase, removes non-alpha chars and converts spaces to hyphens"
- value = re.sub('[^\w\s]', '', value).strip().lower()
+ value = re.sub('[^\w\s-]', '', value).strip().lower()
return re.sub('\s+', '-', value)
-
+
def stringformat(value, arg):
"""
Formats the variable according to the argument, a string formatting specifier.
This specifier uses Python string formating syntax, with the exception that
the leading "%" is dropped.
-
+
See http://docs.python.org/lib/typesseq-strings.html for documentation
of Python string formatting
"""