Browse Source

add register_admin to abx hookspec

Nick Sweeting 1 year ago
parent
commit
a7c19a5da0
2 changed files with 8 additions and 0 deletions
  1. 5 0
      archivebox/abx/django/hookspec.py
  2. 3 0
      archivebox/abx/django/use.py

+ 5 - 0
archivebox/abx/django/hookspec.py

@@ -110,6 +110,11 @@ def register_checks():
     """Register django checks with django system checks system"""
     pass
 
+@hookspec
+def register_admin(admin_site):
+    """Register django admin views/models with the main django admin site instance"""
+    pass
+
 
 ###########################################################################################
 

+ 3 - 0
archivebox/abx/django/use.py

@@ -96,3 +96,6 @@ def register_checks():
     """register any django system checks"""
     pm.hook.register_checks()
 
+def register_admin(admin_site):
+    """register any django admin models/views with the main django admin site instance"""
+    pm.hook.register_admin(admin_site=admin_site)