admin.py 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. from django.contrib import admin
  2. from .models import KeywordMission, DateMission, TimeMission, PageMission, ArticleMission
  3. # Register your models here.
  4. class KeywordMissionAdmin(admin.ModelAdmin):
  5. list_display = ["keyword_mission_id", "keyword", "publisher"]
  6. class DateMissionAdmin(admin.ModelAdmin):
  7. list_display = ["date_mission_id", "date", "is_date_finished", "keyword_mission"]
  8. class TimeMissionAdmin(admin.ModelAdmin):
  9. list_display = ["time_mission_id", "time", "is_time_finished", "date_mission"]
  10. class PageMissionAdmin(admin.ModelAdmin):
  11. list_display = ["page_mission_id", "page", "time_mission", "finisher"]
  12. class ArticleMissionAdmin(admin.ModelAdmin):
  13. list_display = ["article_mission_id", "page_mission", "article_id", "publish_time", "content", "like_count",
  14. "comment_count"]
  15. admin.site.register(KeywordMission, KeywordMissionAdmin)
  16. admin.site.register(DateMission, DateMissionAdmin)
  17. admin.site.register(TimeMission, TimeMissionAdmin)
  18. admin.site.register(PageMission, PageMissionAdmin)
  19. admin.site.register(ArticleMission, ArticleMissionAdmin)