from django.contrib import admin

# Register your models here.
from .models import (
    Course, Announcement, Comment, Enrollment, Lesson, Material
)


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


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([Enrollment, Announcement, Comment, Material])
admin.site.register(Lesson, LessonAdmin)

@@ -89,16 +89,35 @@
  Course,
+%0A    CourseTRB,%0A   
  Announc
@@ -114,32 +114,36 @@
    Announcement,
+%0A   
  Comment, Enroll
@@ -135,16 +135,20 @@
 Comment,
+%0A   
  Enrollm
@@ -155,16 +155,20 @@
 ent,
+%0A   
  Lesson,
  Mat
@@ -163,25 +163,114 @@
  Lesson,
- Material
+%0A    LessonTRB,%0A    Material,%0A    KnowledgeLevel,%0A    CategoryDimensionCognitiveProcess,%0A    Verb,
 %0A)%0A%0A%0Acla
@@ -451,16 +451,62 @@
 me'%5D%7D%0A%0A%0A
+class CourseTRBAdmin(CourseAdmin):%0A    pass%0A%0A%0A
 class Ma
@@ -799,16 +799,17 @@
 %0A    %5D%0A%0A
+%0A
 admin.si
@@ -841,16 +841,63 @@
 eAdmin)%0A
+admin.site.register(CourseTRB, CourseTRBAdmin)%0A
 admin.si
@@ -955,16 +955,16 @@
 erial%5D)%0A
-
 admin.si
@@ -992,12 +992,173 @@
 essonAdmin)%0A
+admin.site.register(LessonTRB, LessonAdmin)%0Aadmin.site.register(KnowledgeLevel)%0Aadmin.site.register(CategoryDimensionCognitiveProcess)%0Aadmin.site.register(Verb)%0A

Add new classes in admin