django-autoslug
django-autoslug copied to clipboard
Feature request: generating slug from multiple fields
Like:
slug = AutoSlugField(populate_from=['title', 'model'])
Yeah, that would be awesome.
You can anyway do it using a callable like (not tested though):
from django.utils.text import slugify
def populate_from(instance):
return f"{slugify(instance.title)}-{slugify(instance.model)}"
....
slug = AutoSlugField(populate_from=populate_from)
But anyway, I see, this feature would be great to maintain compatibility with AutoSlufField from django-extensions.