django-randomslug

Reusable Django application providing the custom RandomSlugField model field
Download

django-randomslug Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Tvrtko Majstorovic
  • Publisher web site:
  • http://github.com/TvrtkoM/

django-randomslug Tags


django-randomslug Description

django-randomslug is a simple model field providing random & unique slug field for your Django models.Installationpython setup.py installor:pip install django-randomslugAppend 'randomslug' to your INSTALLED_APPS settingUsageCreate a django model like usual and add a RandomSlugField:# models.pyfrom randomslug.models import RandomSlugFieldclass ModelWithSlug(models.Model): slug = RandomSlugField()The slug value will now be randomized each when the model has to be saved to database for the first time. If the same value already exist the value will get suffix of the pattern "_%d" % number where number is positive integer, so each slug will be unique.RandomSlugField accepts slug_length option which represents the number of randomized characters in slug (excluding number suffix) e.g. slugs 'xc-45' & 'xf987_23' are both of the slug_length 5.Product's homepage


django-randomslug Related Software