From fe5b3c41aa898fa7491a7ec9bce28c5e1c5b542d Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 6 Nov 2020 18:21:48 +0530 Subject: Statistics app for video tracking --- stats/admin.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 stats/admin.py (limited to 'stats/admin.py') diff --git a/stats/admin.py b/stats/admin.py new file mode 100644 index 0000000..b400d27 --- /dev/null +++ b/stats/admin.py @@ -0,0 +1,8 @@ +# Django Imports +from django.contrib import admin + +# Local Imports +from stats.models import TrackLesson + + +admin.site.register(TrackLesson) -- cgit 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(-) (limited to 'stats/admin.py') 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