From 2a9825d72f6ed8b995dcab097e8a40bca92e0feb Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 8 Apr 2021 14:24:08 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Make=20a=20common=20CoreAdmin=20cla?= =?UTF-8?q?ss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sophon/core/admin.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sophon/core/admin.py b/sophon/core/admin.py index 1be7790..a7843f4 100644 --- a/sophon/core/admin.py +++ b/sophon/core/admin.py @@ -2,16 +2,22 @@ from django.contrib import admin from . import models +class CoreAdmin(admin.ModelAdmin): + """ + :class:`django.contrib.admin.ModelAdmin` class from which all other admin classes inherit. + """ + + @admin.register(models.Project) -class ProjectAdmin(admin.ModelAdmin): +class ProjectAdmin(CoreAdmin): pass @admin.register(models.DataSource) -class DataSourceAdmin(admin.ModelAdmin): +class DataSourceAdmin(CoreAdmin): pass @admin.register(models.DataFlow) -class DataFlowAdmin(admin.ModelAdmin): +class DataFlowAdmin(CoreAdmin): pass