Feature request: generating slug from multiple fields
just-developr-m opened this issue · comments
just-developr-m commented
Like:
slug = AutoSlugField(populate_from=['title', 'model'])
Rasul Kireev commented
Yeah, that would be awesome.
Antonio Ercole De Luca commented
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.