From 0872024fc51e92e182b90813e7b274887218da51 Mon Sep 17 00:00:00 2001 From: zft9xgy Date: Fri, 26 Jul 2024 00:46:58 +0200 Subject: [PATCH] add: tags, prepopulate slug on create --- tags/admin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tags/admin.py b/tags/admin.py index 4167ec8..ece6dc4 100644 --- a/tags/admin.py +++ b/tags/admin.py @@ -2,4 +2,8 @@ from tags.models import Tag -admin.site.register(Tag) + +class TagAdmin(admin.ModelAdmin): + prepopulated_fields = {"slug": ("name",)} + +admin.site.register(Tag, TagAdmin) \ No newline at end of file