@@ -15,7 +15,24 @@ class ContentItemAdmin(admin.ModelAdmin):
|
||||
)
|
||||
list_filter = ("kind", "ability_dimension", "discipline", "is_published")
|
||||
search_fields = ("title", "summary", "body")
|
||||
ordering = ("-published_at", "title")
|
||||
list_editable = ("is_published",)
|
||||
readonly_fields = ("view_count", "comment_count")
|
||||
|
||||
|
||||
admin.site.register(ContentInteraction)
|
||||
admin.site.register(VideoProgress)
|
||||
@admin.register(ContentInteraction)
|
||||
class ContentInteractionAdmin(admin.ModelAdmin):
|
||||
list_display = ("user", "content", "action", "created_at")
|
||||
list_filter = ("action", "content__kind")
|
||||
search_fields = ("user__username", "user__nickname", "content__title")
|
||||
readonly_fields = ("user", "content", "action", "created_at")
|
||||
ordering = ("-created_at",)
|
||||
|
||||
|
||||
@admin.register(VideoProgress)
|
||||
class VideoProgressAdmin(admin.ModelAdmin):
|
||||
list_display = ("user", "content", "completed", "reward_granted", "updated_at")
|
||||
list_filter = ("completed", "reward_granted", "content__ability_dimension")
|
||||
search_fields = ("user__username", "user__nickname", "content__title")
|
||||
readonly_fields = ("user", "content", "updated_at", "completed_at")
|
||||
ordering = ("-updated_at",)
|
||||
|
||||
@@ -2,5 +2,6 @@ from django.apps import AppConfig
|
||||
|
||||
|
||||
class ContentConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'content'
|
||||
default_auto_field = "django.db.models.BigAutoField"
|
||||
name = "content"
|
||||
verbose_name = "视频与探索内容"
|
||||
|
||||
Reference in New Issue
Block a user