rezamalik15

Untitled

Aug 22nd, 2023
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.87 KB | None | 0 0
  1. from django.contrib import admin
  2. from .models import (
  3.     Post,
  4.     Event,
  5.     Project,
  6.     Student,
  7.     Generation,
  8.     Achievement,
  9.     AchievementPhoto,
  10.     )
  11.  
  12. # Register your models here.
  13.  
  14. class PostAdmin(admin.ModelAdmin):
  15.     list_display = ("id", "image", "caption", "publish", "created_at", "created_by_id")
  16.  
  17. class EventAdmin(admin.ModelAdmin):
  18.     list_display = (
  19.         "id",
  20.         "image",
  21.         "description",
  22.         "date_start",
  23.         "date_end",
  24.         "is_published",
  25.         "attachment_link",
  26.         "created_at",
  27.         "created_by_id"
  28.     )
  29.  
  30. class ProjectAdmin(admin.ModelAdmin):
  31.     list_display = (
  32.         'id',
  33.         'description',
  34.         'image',
  35.         'video_link',
  36.         'attachment_link',
  37.         'is_published',
  38.         'created_at',
  39.         'created_by_id'
  40.     )
  41.  
  42. class GenerationAdmin(admin.ModelAdmin):
  43.     list_display = (
  44.         'id',
  45.         'name',
  46.         'school_year',
  47.         'is_active'
  48.     )
  49.  
  50. class StudentAdmin(admin.ModelAdmin):
  51.     list_display = (
  52.         'nisn',
  53.         'nis',
  54.         'firstname',
  55.         'lastname',
  56.         'is_active',
  57.         'generation'
  58.     )
  59.  
  60. class AchievementAdmin(admin.ModelAdmin):
  61.     list_display = (
  62.         'id',
  63.         'description',
  64.         # 'project',
  65.         'event_name',
  66.         'is_published',
  67.         'created_at',
  68.         'created_by',
  69.     )
  70.  
  71. class AchievementPhotoAdmin(admin.ModelAdmin):
  72.     list_display = (
  73.         'id',
  74.         'photo',
  75.         'created_at',
  76.         'created_by'
  77.     )
  78.    
  79. admin.site.register(Post, PostAdmin)
  80. admin.site.register(Event, EventAdmin)
  81. admin.site.register(Project, ProjectAdmin)
  82. admin.site.register(Generation, GenerationAdmin)
  83. admin.site.register(Student, StudentAdmin)
  84. admin.site.register(Achievement, AchievementAdmin)
  85. admin.site.register(AchievementPhoto, AchievementPhotoAdmin)
Advertisement
Add Comment
Please, Sign In to add comment