# _*_ coding:utf-8 _*_
__author__ = 'zyzy'
__date__ = '2017/5/22 15:39'

import xadmin

from . import models


class UserAskAdmin(object):
    list_display = ['name', 'mobile', 'course_name', 'add_time']
    search_fields = ['name', 'mobile', 'course_name']
    list_filter = ['name', 'mobile', 'course_name', 'add_time']


class CourseCommentsAdmin(object):
    list_display = ['user', 'course', 'comments', 'add_time']
    search_fields = ['user', 'course', 'comments']
    list_filter = ['user', 'course', 'comments', 'add_time']


class UserFavoriteAdmin(object):
    list_display = ['user', 'fav_id', 'fav_type', 'add_time']
    search_fields = ['user', 'fav_id', 'fav_type']
    list_filter = ['user', 'fav_id', 'fav_type', 'add_time']


class UserMessageAdmin(object):
    list_display = ['user', 'message', 'has_read', 'add_time']
    search_fields = ['user', 'message', 'has_read']
    list_filter = ['user', 'message', 'has_read', 'add_time']


class UserCourseAdmin(object):
    list_display = ['user', 'course', 'add_time']
    search_fields = ['user', 'course']
    list_filter = ['user', 'course', 'add_time']

xadmin.site.register(models.UserAsk, UserAskAdmin)
xadmin.site.register(models.CourseComments, CourseCommentsAdmin)
xadmin.site.register(models.UserFavorite, UserFavoriteAdmin)
xadmin.site.register(models.UserMessage, UserMessageAdmin)
xadmin.site.register(models.UserCourse, UserCourseAdmin)
# _*_ coding:utf-8 _*_
__author__ = 'zyzy'
__date__ = '2017/5/22 15:39'

import xadmin

from . import models


class UserAskAdmin(object):
    list_display = ['name', 'mobile', 'course_name', 'add_time']
    search_fields = ['name', 'mobile', 'course_name']
    list_filter = ['name', 'mobile', 'course_name', 'add_time']


class CourseCommentsAdmin(object):
    list_display = ['user', 'course', 'comments', 'add_time']
    search_fields = ['user', 'course', 'comments']
    list_filter = ['user', 'course', 'comments', 'add_time']


class UserFavoriteAdmin(object):
    list_display = ['user', 'fav_id', 'fav_type', 'add_time']
    search_fields = ['user', 'fav_id', 'fav_type']
    list_filter = ['user', 'fav_id', 'fav_type', 'add_time']


class UserMessageAdmin(object):
    list_display = ['user', 'message', 'has_read', 'add_time']
    search_fields = ['user', 'message', 'has_read']
    list_filter = ['user', 'message', 'has_read', 'add_time']


class UserCourseAdmin(object):
    list_display = ['user', 'course', 'add_time']
    search_fields = ['user', 'course']
    list_filter = ['user', 'course', 'add_time']

xadmin.site.register(models.UserAsk, UserAskAdmin)
xadmin.site.register(models.CourseComments, CourseCommentsAdmin)
xadmin.site.register(models.UserFavorite, UserFavoriteAdmin)
xadmin.site.register(models.UserMessage, UserMessageAdmin)
xadmin.site.register(models.UserCourse, UserCourseAdmin)
# _*_ coding:utf-8 _*_