from django.contrib import admin

# Register your models here.
from .models import (
    Course,
    CourseTRB,
    Announcement,
    Comment,
    Enrollment,
    Lesson,
    LessonTRB,
    Material,
    KnowledgeLevel,
    CategoryDimensionCognitiveProcess,
    Verb,
)


class CourseAdmin(admin.ModelAdmin):
    list_display = ['name', 'slug', 'start_date', 'created_at']
    search_fields = ['name', 'slug']
    prepopulated_fields = {'slug': ['name']}


class CourseTRBAdmin(CourseAdmin):
    pass


class MaterialInlineAdmin(admin.StackedInline):

    model = Material


class LessonAdmin(admin.ModelAdmin):
    list_display = ['name', 'number', 'course', 'release_date']
    search_fields = ['name', 'description']
    list_filter = ['created_at']

    inlines = [
        MaterialInlineAdmin
    ]


admin.site.register(Course, CourseAdmin)
admin.site.register(CourseTRB, CourseTRBAdmin)
admin.site.register([Enrollment, Announcement, Comment, Material])
admin.site.register(Lesson, LessonAdmin)
admin.site.register(LessonTRB, LessonAdmin)
admin.site.register(KnowledgeLevel)
admin.site.register(CategoryDimensionCognitiveProcess)
admin.site.register(Verb)

@@ -101,24 +101,43 @@
  CourseTRB,%0A
+    CourseRequest,%0A
     Announce
@@ -138,24 +138,24 @@
 nouncement,%0A
-
     Comment,
@@ -237,32 +237,85 @@
 l,%0A    C
-ategoryDimension
+hooseKnowledgeLevel,%0A    ChooseCategoryCognitiveProcess,%0A    Category
 Cognitiv
@@ -575,30 +575,29 @@
 %0A%0Aclass 
-MaterialInline
+CourseRequest
 Admin(ad
@@ -604,45 +604,142 @@
 min.
-StackedInl
+ModelAdm
 in
-e
 ):%0A
-%0A
     
-model = Material
+list_display = %5B'name', 'description', 'start_date', 'professor', 'is_trb'%5D%0A    search_fields = %5B'name', 'professor'%5D
 %0A%0A%0Ac
@@ -920,59 +920,8 @@
 '%5D%0A%0A
-    inlines = %5B%0A        MaterialInlineAdmin%0A    %5D%0A%0A
 %0Aadm
@@ -1001,24 +1001,79 @@
 seTRBAdmin)%0A
+admin.site.register(CourseRequest, CourseRequestAdmin)%0A
 admin.site.r
@@ -1273,24 +1273,109 @@
 er(C
-ategoryDimension
+hooseKnowledgeLevel)%0Aadmin.site.register(CategoryCognitiveProcess)%0Aadmin.site.register(ChooseCategory
 Cogn

Add new models in admin