Login

Tag "slugs"

Snippet List

Slugify alternative

I prefer to use this slugification function rather than the one included with Django. It uses underscores instead of dashes for spaces, and allows dashes and periods to occur normally in the string. I decided on this when considering reasonable slugified titles such as... object-relational_mapper_2.5 ten_reasons_web-2.0_rocks django-trunk_0.99_updated

  • filter
  • slugs
  • slug
  • slugify
Read More

slugify js -> python

This code is derived from the slugify JS function used in django's admin interface. It will create django-compatible slugs for you. Sometimes I do batch imports and need my items to have slugs, I give this script the item's title and get a slug back. Simple

  • slugs
Read More

3 snippets posted so far.