From 6640306113e5dfa2f04e0375edab2cf2b5cbf142 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 3 Dec 2020 17:59:45 -0500 Subject: [PATCH] Prepopulate the slug field in the Task Admin page --- tasks/admin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks/admin.py b/tasks/admin.py index 6c3bda0..197063c 100644 --- a/tasks/admin.py +++ b/tasks/admin.py @@ -3,5 +3,11 @@ from django.contrib import admin from .models import Tool, Task, Event admin.site.register(Tool) -admin.site.register(Task) + + +@admin.register(Task) +class TaskAdmin(admin.ModelAdmin): + prepopulated_fields = {"slug": ("name",)} + + admin.site.register(Event)