You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
469 B

from django.contrib import admin
from apps.course.models import Lesson
@admin.register(Lesson)
class LessonAdmin(admin.ModelAdmin):
list_display = ('title', 'course', 'priority', 'duration', 'content_type')
list_filter = ('course', 'content_type')
search_fields = ('title', 'course__title')
ordering = ('priority', 'title')
def get_queryset(self, request):
qs = super().get_queryset(request)
return qs.order_by('priority')