Django

Code

Changeset 464

Show
Ignore:
Timestamp:
08/10/05 10:40:14 (3 years ago)
Author:
adrian
Message:

Fixed #299 -- Slugify no longer removes hyphens. Thanks, gch@cs.cmu.edu

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/defaultfilters.py

    r3 r464  
    5555def slugify(value, _): 
    5656    "Converts to lowercase, removes non-alpha chars and converts spaces to hyphens" 
    57     value = re.sub('[^\w\s]', '', value).strip().lower() 
     57    value = re.sub('[^\w\s-]', '', value).strip().lower() 
    5858    return re.sub('\s+', '-', value) 
    59      
     59 
    6060def stringformat(value, arg): 
    6161    """ 
     
    6363    This specifier uses Python string formating syntax, with the exception that 
    6464    the leading "%" is dropped. 
    65      
     65 
    6666    See http://docs.python.org/lib/typesseq-strings.html for documentation 
    6767    of Python string formatting