admin.py 715 B

12345678910111213141516171819202122232425
  1. from django.contrib import admin
  2. from .models import Article, Tag, ArticleClass, Draft
  3. # Register your models here.
  4. class ArticleAdmin(admin.ModelAdmin):
  5. list_display = ["ArticleId", "Publisher", "Title", "Content", "Cover", "Read", "Like", "Publish_Time", "Edit_Time"]
  6. class ArticleClassAdmin(admin.ModelAdmin):
  7. list_display = ["Name", ]
  8. class TagAdmin(admin.ModelAdmin):
  9. list_display = ["Name", ]
  10. class DraftAdmin(admin.ModelAdmin):
  11. list_display = ["DraftId", "Poster", "Title", "Content", "Add_Time", "Edit_Time", ]
  12. admin.site.register(Article, ArticleAdmin)
  13. admin.site.register(Tag, TagAdmin)
  14. admin.site.register(ArticleClass, ArticleClassAdmin)
  15. admin.site.register(Draft, DraftAdmin)