High Fidelity Slugify : support for international characters

61 views
Skip to first unread message

Sam

unread,
Mar 12, 2007, 9:52:55 AM3/12/07
to Django users
I needed slugify to be more precise with accented characters and i
couldn't find some code to do it, so here it is :

http://amisphere.com/contrib/python-django/slughifi.py

http://amisphere.com/contrib/python-django/ for a quick overview

example :
>>> text = "C'est déjà l'été."
>>> slughifi(text, overwrite_char_map={u"'": "-",})
'c-est-deja-l-ete'

Any comments ?

Aidas Bendoraitis

unread,
Mar 12, 2007, 12:35:11 PM3/12/07
to django...@googlegroups.com
There were similar tryings to create international slugification before:
http://groups.google.com/group/django-users/browse_thread/thread/6942f87bed76a536/8d38392e25dd1974

But your approach seems to be more generic. You should certainly post
it on djangosnippets.org as a separate snippet or (maybe better) as an
extension suggestion for http://www.djangosnippets.org/snippets/98/

Regards,
Aidas Bendoraitis [aka Archatas]

Reply all
Reply to author
Forward
0 new messages