aboutsummaryrefslogtreecommitdiffstats
path: root/pyblackbird_cc/resources/admin.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-08-03 21:38:07 +0100
committerMatthew Lemon <y@yulqen.org>2024-08-03 21:38:45 +0100
commit82557e058b9c98424d612bf0eaa917e4fe222480 (patch)
tree547e74ba2c682655905df374010f103e9669336f /pyblackbird_cc/resources/admin.py
parent597c58300422aadcdc58a027e7334dd3cf3600a9 (diff)
Add admin models for PDFResource and PDFPageSnapshot
Expand the admin interface to include PDFResource and PDFPageSnapshot models. The new admin classes define `list_display` attributes to manage displayed columns in the admin list views.
Diffstat (limited to '')
-rw-r--r--pyblackbird_cc/resources/admin.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pyblackbird_cc/resources/admin.py b/pyblackbird_cc/resources/admin.py
index a9662ee..ac45efb 100644
--- a/pyblackbird_cc/resources/admin.py
+++ b/pyblackbird_cc/resources/admin.py
@@ -1,7 +1,7 @@
# Register your models here.
from django.contrib import admin
-from pyblackbird_cc.resources.models import Resource, ResourceSubcategory
+from pyblackbird_cc.resources.models import Resource, ResourceSubcategory, PDFPageSnapshot, PDFResource
from pyblackbird_cc.resources.models import ResourceCategory
from pyblackbird_cc.resources.models import ResourceType
@@ -24,3 +24,13 @@ class ResourceSubcategoryAdmin(admin.ModelAdmin):
@admin.register(Resource)
class ResourceAdmin(admin.ModelAdmin):
pass
+
+
+@admin.register(PDFResource)
+class PDFResourceAdmin(admin.ModelAdmin):
+ list_display = ["resource", "file_name", "file_size"]
+
+
+@admin.register(PDFPageSnapshot)
+class PDFPageSnapshotAdmin(admin.ModelAdmin):
+ list_display = ["file_name", "pdf_file"]