summaryrefslogtreecommitdiff
path: root/yaksh/admin.py
blob: 3d09f6981466d35849fdfaae0cd4cece592a7788 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from yaksh.models import Question, Quiz, QuestionPaper, Profile
from yaksh.models import (TestCase, StandardTestCase, StdIOBasedTestCase,
                          Course, AnswerPaper, CourseStatus, LearningModule,
                          Lesson
                          )
from django.contrib import admin


class AnswerPaperAdmin(admin.ModelAdmin):
    search_fields = ['user__first_name', 'user__last_name', 'user__username',
                     "question_paper__quiz__description", "user_ip"]


class ProfileAdmin(admin.ModelAdmin):
    search_fields = ['user__first_name', 'user__last_name', 'user__username',
                     "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, 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)