Commit be68cbd0 authored by Matheus Miranda's avatar Matheus Miranda
Browse files

Add CourseTrack admin

parent b3de967e
...@@ -7,8 +7,8 @@ from .videos.models import Video ...@@ -7,8 +7,8 @@ from .videos.models import Video
from .models import ( from .models import (
Course, Lesson, Unit, CourseProfessor, CourseStudent, Course, Lesson, Unit, CourseProfessor, CourseStudent,
StudentProgress, Class, StudentProgress, Class,
ProfessorMessage, ProfessorMessage, CourseAuthor,
CourseAuthor, CourseCategory, CourseTrack,
) )
from .course_material.models import CourseMaterial, File from .course_material.models import CourseMaterial, File
...@@ -36,6 +36,14 @@ class CourseAdmin(admin.ModelAdmin): ...@@ -36,6 +36,14 @@ class CourseAdmin(admin.ModelAdmin):
] ]
@admin.register(CourseTrack)
class CourseTrackAdmin(admin.ModelAdmin):
list_display = ('name', 'home_position')
filter_horizontal = [
'courses',
]
class UnitInline(admin.TabularInline): class UnitInline(admin.TabularInline):
model = Unit model = Unit
fields = ('title', 'video', 'position',) fields = ('title', 'video', 'position',)
...@@ -151,3 +159,5 @@ class ClassroomAdmin(admin.ModelAdmin): ...@@ -151,3 +159,5 @@ class ClassroomAdmin(admin.ModelAdmin):
'group__name', 'group__name',
'assistants__name', 'assistants__name',
) )
admin.site.register(CourseCategory)
...@@ -35,10 +35,15 @@ class CourseCategory(models.Model): ...@@ -35,10 +35,15 @@ class CourseCategory(models.Model):
color = models.CharField(_("color"), max_length=7, blank=True, color = models.CharField(_("color"), max_length=7, blank=True,
help_text=_("Title color in hex format (i.e: #1aafd0).")) help_text=_("Title color in hex format (i.e: #1aafd0)."))
class Meta:
verbose_name = _('Course Category')
verbose_name_plural = _('Course Categories')
def __str__(self): def __str__(self):
return self.name return self.name
class Course(models.Model): class Course(models.Model):
STATES = ( STATES = (
('draft', _('Draft')), ('draft', _('Draft')),
...@@ -343,6 +348,10 @@ class CourseTrack(models.Model): ...@@ -343,6 +348,10 @@ class CourseTrack(models.Model):
verbose_name='courses', verbose_name='courses',
blank=True, blank=True,
) )
home_position = models.IntegerField(
null=True,
blank=True,
)
class Meta: class Meta:
verbose_name = _('Course Track') verbose_name = _('Course Track')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment