djangosnippets.org: Latest snippets posted by jcrawfordhttps://djangosnippets.org/users/jcrawford/2009-04-10T11:52:14.034377-05:00jcrawfordBuilt-in Slugify with filtering.
2009-04-10T11:52:14.034377-05:00jcrawfordhttps://djangosnippets.org/snippets/1427/<p>This is based on snippets 29 and 43, both of which had good ideas, and I thought, "why not combine them?"</p>
<p>Given the new_topic string above, the resulting slug will be:</p>
<p>"test-long-string-which-has-many-words-here"</p>
<p>John Crawford</p>
<p>Note - requires python 2.5, for list comprehensions. Otherwise you could just use a for loop …</p>
Freely redistributable