from django.contrib import admin # Register your models here. from apps.AppInfoManage.models import Diseases,App_Insect,App_Plant,Feedback #病虫害知识库表 @admin.register(Diseases) class DiseasesAdmin(admin.ModelAdmin): actions_on_bottom = False actions_on_top = True # 详情显示项: fields = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'ret', ] # 列表显示项: list_display = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'ret', ] # 点击进入详情修改项: list_display_links = ('name',) # 链接:无 # list_display_links = None # 搜索字段项: search_fields = ['name','course'] # # 动作: # actions = [ds_off, ds_on] # 设置显示外键字段 # fk_fields = ('ids',) # raw_id_fields = ("ids",) # 设置每页显示记录数: list_per_page = 10 #虫害识别保存表 @admin.register(App_Insect) class App_InsectAdmin(admin.ModelAdmin): actions_on_bottom = False actions_on_top = True # 详情显示项: fields = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'reporter_id', 'img', 'addr', 'lng', 'lat', 'userid' ] # 列表显示项: list_display = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'reporter_id', 'img', 'addr', 'lng', 'lat', 'userid' ] # 点击进入详情修改项: list_display_links = ('name',) # 链接:无 # list_display_links = None # 搜索字段项: search_fields = ['name','course'] # # 动作: # actions = [ds_off, ds_on] # 设置显示外键字段 fk_fields = ('reporter_id',"userid") raw_id_fields = ("reporter_id","userid") # 设置每页显示记录数: list_per_page = 10 #植物识别表 @admin.register(App_Plant) class App_PlantAdmin(admin.ModelAdmin): actions_on_bottom = False actions_on_top = True # 详情显示项: fields = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'reporter_id', 'img', 'addr', 'lng', 'lat', 'userid' ] # 列表显示项: list_display = [ 'name', 'course', 'prevention', 'img_urls', 'time', 'reporter_id', 'img', 'addr', 'lng', 'lat', 'userid' ] # 点击进入详情修改项: list_display_links = ('name',) # 链接:无 # list_display_links = None # 搜索字段项: search_fields = ['name','course'] # # 动作: # actions = [ds_off, ds_on] # 设置显示外键字段 fk_fields = ('reporter_id',"userid") raw_id_fields = ("reporter_id","userid") # 设置每页显示记录数: list_per_page = 10 #用户反馈表 @admin.register(Feedback) class FeedbackAdmin(admin.ModelAdmin): actions_on_bottom = False actions_on_top = True # 详情显示项: fields = [ 'name', 'phone', 'proposal', 'count', 'time', 'store', ] # 列表显示项: list_display = [ 'name', 'phone', 'proposal', 'count', 'time', 'store', ] # 点击进入详情修改项: list_display_links = ('name',) # 链接:无 # list_display_links = None # 搜索字段项: search_fields = ['name','phone'] # # 动作: # actions = [ds_off, ds_on] # 设置显示外键字段 # fk_fields = ('ids',) # raw_id_fields = ("ids",) # 设置每页显示记录数: list_per_page = 10