示例#1
0
class CourseOrgAdmin(object):
    obj = org.CourseOrg
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
    # 当有个外键指向他的时候,以搜索模式
    relfield_style = 'fx-ajax'
示例#2
0
class CourseAdmin(object):
    obj = course.Course
    list_display = [
        'name', 'id', 'course_org', 'teacher', 'desc', 'degree', 'click_num'
    ]
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
    # 显示排序
    ordering = ['-click_num']
    # 只读字段
    readonly_fields = ['click_num']
    # 去除字段显示
    exclude = ['favourite_mun']
    # icon
    model_icon = 'fa fa-group'

    style_fields = {'detail': 'ueditor'}

    import_excel = True
    inlines = [LessonInline, CourseResourseInline]

    def post(self, request, *args, **kwargs):
        if 'excel' in request.FILES:
            pass
        return super(CourseAdmin, self).post(request, args, kwargs)
示例#3
0
class UserCourseAdmin(object):
    obj = operation.UserCourse
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#4
0
class CourseCommentsAdmin(object):
    obj = operation.CourseComments
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#5
0
class CourseResourceAdmin(object):
    obj = course.CourseResource
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#6
0
class VideoAdmin(object):
    obj = course.Video
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#7
0
class LessonAdmin(object):
    obj = course.Lesson
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#8
0
class CityDictAdmin(object):
    obj = org.CityDict
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)
示例#9
0
class TeacherAdmin(object):
    obj = org.Teacher
    list_display = get_list_display(obj)
    search_fields = get_search_fields(obj)
    list_filter = get_list_display(obj)