is there any way to integrate an autoslugfield from django-autoslug into the Django-admin interface? I tried putting it inside a list_display as 'slug' but it doesn't show up then in the django-admin interface.
Thanks a lot
is there any way to integrate an autoslugfield from django-autoslug into the Django-admin interface? I tried putting it inside a list_display as 'slug' but it doesn't show up then in the django-admin interface.
Thanks a lot
This is old question but maybe someone will find this answer usefull to display in admin interface (and make it editable)
all you need to do set editable=True
slug = AutoSlugField(populate_from='title', editable=True, blank=True)
and now its autogenerated only if slug is not filled... and also slug is not regenerated in pupulated_from is changed.
Why do you want to add it into admin interface? It shouldn't be editable anyway.
You can add it as a read-only field though.
class MyModelAdmin(admin.ModelAdmin):
list_display = ('slug',)
readonly_fields = ('slug',)