Ticket #2276: defaultfilters.py.2.diff

File defaultfilters.py.2.diff, 606 bytes (added by nkeric, 18 years ago)

new diff with re.U replaced with re.UNICODE

  • django/template/defaultfilters.py

     
    6565
    6666def slugify(value):
    6767    "Converts to lowercase, removes non-alpha chars and converts spaces to hyphens"
    68     value = re.sub('[^\w\s-]', '', value).strip().lower()
     68    value = unicode(value, 'utf-8')
     69    p = re.compile('[^\w\s-]', re.UNICODE)
     70    value = re.sub(p, '', value).strip().lower()
    6971    return re.sub('[-\s]+', '-', value)
    7072
    7173def stringformat(value, arg):
Back to Top