| 118 | | "Converts to lowercase, removes non-alpha chars and converts spaces to hyphens" |
|---|
| 119 | | # Don't compile patterns as unicode because \w then would mean any letter. |
|---|
| 120 | | # Slugify is effectively a conversion to ASCII. |
|---|
| 121 | | value = re.sub('[^\w\s-]', '', value).strip().lower() |
|---|
| | 118 | """ |
|---|
| | 119 | Normalizes string, converts to lowercase, removes non-alpha chars and |
|---|
| | 120 | converts spaces to hyphens. |
|---|
| | 121 | """ |
|---|
| | 122 | import unicodedata |
|---|
| | 123 | value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') |
|---|
| | 124 | value = unicode(re.sub('[^\w\s-]', '', value).strip().lower()) |
|---|