diff options
author | adityacp | 2020-02-13 09:51:15 +0530 |
---|---|---|
committer | adityacp | 2020-02-13 09:51:15 +0530 |
commit | 20c8ebbd65f694bfbf18c229d7b3dfabf439fa3f (patch) | |
tree | 25b0f73c4f4628e9c67058794df5578c044f6e7c /yaksh/admin.py | |
parent | d7a461639cd57fe78121375bd6730cacecbd63e5 (diff) | |
parent | 32f1d4dc7816bbb93f6dda77591eeb75c3f30c0d (diff) | |
download | online_test-20c8ebbd65f694bfbf18c229d7b3dfabf439fa3f.tar.gz online_test-20c8ebbd65f694bfbf18c229d7b3dfabf439fa3f.tar.bz2 online_test-20c8ebbd65f694bfbf18c229d7b3dfabf439fa3f.zip |
Merge branch 'master' of https://github.com/FOSSEE/online_test into revamp_ui
Diffstat (limited to 'yaksh/admin.py')
-rw-r--r-- | yaksh/admin.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/yaksh/admin.py b/yaksh/admin.py index 7ea8ed6..495b48d 100644 --- a/yaksh/admin.py +++ b/yaksh/admin.py @@ -1,6 +1,8 @@ from yaksh.models import Question, Quiz, QuestionPaper, Profile from yaksh.models import (TestCase, StandardTestCase, StdIOBasedTestCase, - Course, AnswerPaper) + Course, AnswerPaper, CourseStatus, LearningModule, + Lesson + ) from django.contrib import admin @@ -14,12 +16,36 @@ class ProfileAdmin(admin.ModelAdmin): "roll_number", "institute", "department"] +class CourseStatusAdmin(admin.ModelAdmin): + search_fields = ['user__first_name', 'user__last_name', 'user__username'] + list_filter = ['course__is_trial'] + + +class CourseAdmin(admin.ModelAdmin): + list_filter = ['active', 'is_trial'] + + +class LearningModuleAdmin(admin.ModelAdmin): + list_filter = ['active', 'is_trial'] + + +class LessonAdmin(admin.ModelAdmin): + list_filter = ['active'] + + +class QuizAdmin(admin.ModelAdmin): + list_filter = ['active', 'is_trial'] + + admin.site.register(Profile, ProfileAdmin) admin.site.register(Question) admin.site.register(TestCase) admin.site.register(StandardTestCase) admin.site.register(StdIOBasedTestCase) -admin.site.register(Course) -admin.site.register(Quiz) +admin.site.register(Course, CourseAdmin) +admin.site.register(Quiz, QuizAdmin) admin.site.register(QuestionPaper) admin.site.register(AnswerPaper, AnswerPaperAdmin) +admin.site.register(CourseStatus, CourseStatusAdmin) +admin.site.register(Lesson, LessonAdmin) +admin.site.register(LearningModule, LearningModuleAdmin) |