Login

Snippets by danux

Snippet List

Automatic slug generation signal

A pre_save signal that will automatically generate a slug for your model based on the "title" attribute, and will store the new slug in the "slug" attribute. USAGE: from django.db.models.signals import pre_save from YOURPACKAGE import slug_generator pre_save.connect(slug_generator, sender=YOURMODEL)

  • slug
  • slugify
  • automatic
Read More

danux has posted 1 snippet.