From eed832d8a67ab9c2cef874b43f73d14a48cd0c71 Mon Sep 17 00:00:00 2001 From: adityacp Date: Sat, 7 Nov 2020 17:44:42 +0530 Subject: Change admin.py for stats app --- stats/admin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/stats/admin.py b/stats/admin.py index b400d27..16ca528 100644 --- a/stats/admin.py +++ b/stats/admin.py @@ -5,4 +5,10 @@ from django.contrib import admin from stats.models import TrackLesson -admin.site.register(TrackLesson) +class TrackLessonAdmin(admin.ModelAdmin): + search_fields = ['user__first_name', 'user__last_name', 'user__username', + 'course__name', 'lesson__name'] + readonly_fields = ["course", "user", "lesson"] + + +admin.site.register(TrackLesson, TrackLessonAdmin) -- cgit