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.
83 lines
1.5 KiB
83 lines
1.5 KiB
from django.contrib import admin
|
|
from movie.model import User, Genre, Movie_hot, Movie_rating, Movie_similarity, Movie
|
|
|
|
admin.site.site_title="电影推荐系统后台管理系统"
|
|
admin.site.site_header="电影推荐系统——后台管理系统"
|
|
admin.site.index_title="电影推荐系统"
|
|
|
|
|
|
@admin.register(User)
|
|
class UserAdmin(admin.ModelAdmin):
|
|
list_display=['id','name','password','email']
|
|
search_fields=['name','email']
|
|
list_per_page=12
|
|
ordering=['id']
|
|
|
|
|
|
@admin.register(Genre)
|
|
class GenreAdmin(admin.ModelAdmin):
|
|
list_display=['id','name']
|
|
search_fields=['name']
|
|
list_per_page=12
|
|
ordering=['id']
|
|
|
|
@admin.register(Movie)
|
|
class MovieAdmin(admin.ModelAdmin):
|
|
list_display=['id','name','imdb_id','time','release_time','intro','director','writers','actor']
|
|
search_fields=['name','intro','writers','actor']
|
|
list_per_page=6
|
|
ordering=['id']
|
|
|
|
@admin.register(Movie_hot)
|
|
class Movie_hotAdmin(admin.ModelAdmin):
|
|
list_display=['id','movie','rating_number']
|
|
search_fields=['movie']
|
|
list_per_page=6
|
|
ordering=['-rating_number']
|
|
|
|
|
|
@admin.register(Movie_rating)
|
|
class Movie_ratingAdmin(admin.ModelAdmin):
|
|
list_display=['id','user','movie','score','comment']
|
|
search_fields=['user','movie']
|
|
list_per_page=6
|
|
ordering=['-score']
|
|
|
|
|
|
@admin.register(Movie_similarity)
|
|
class Movie_similarityAdmin(admin.ModelAdmin):
|
|
list_display=['id','movie_source','movie_target','similarity']
|
|
search_fields=['movie_source','movie_source']
|
|
list_per_page=6
|
|
ordering=['-similarity']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|