Skip to content

Instantly share code, notes, and snippets.

@Rembane
Created March 17, 2012 22:31
Show Gist options
  • Save Rembane/2065896 to your computer and use it in GitHub Desktop.
Save Rembane/2065896 to your computer and use it in GitHub Desktop.
def save(self, *args, **kwargs):
if self.slug == '':
self.slug = slugify(self.<field_you_want_to_base_the_slug_on>)
super(<ClassName>, self).save(*args, **kwargs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment