Source

ultrahtml / apps / modules / admin.py

Full commit
# -*- coding: utf-8 -*-
from django.contrib import admin
from models import Module, Lesson
from forms import LessonAdminForm

class ModuleAdmin(admin.ModelAdmin):
    prepopulated_fields={'slug': ('title',)}

class LessonAdmin(admin.ModelAdmin):
    form = LessonAdminForm
    prepopulated_fields={'slug': ('title',)}
    list_display = ['title','module', 'number', 'visible']
    list_filter = ['module']
    list_editable=['number', 'visible']
    
    fieldsets = (
        ('Essential',{
            'fields' : ('title', 'slug', 'module', 'textile_file')
        }),
        ('description', {
            'fields' : ('description', ),
            'classes': ('collapse',),
        }),
        ('objectives', {
            'fields' : ('objectives', ),
            'classes': ('collapse',),
        }),
        ('Extra Info', {
            'fields' : ('comments', 'visible', 'number'),
            'classes': ('collapse',),
        })
    )

admin.site.register(Module, ModuleAdmin)
admin.site.register(Lesson, LessonAdmin)