30 lines
722 B
Python
30 lines
722 B
Python
from django.contrib import admin
|
|
from django.db import models
|
|
from django.urls import path
|
|
from django.http import HttpResponse
|
|
|
|
|
|
class Controlling(models.Model):
|
|
class Meta:
|
|
verbose_name_plural = 'Controlling'
|
|
app_label = 'aitrainer_backoffice'
|
|
|
|
|
|
def my_custom_view(request):
|
|
return HttpResponse('Admin Custom View')
|
|
|
|
|
|
class ControllingAdmin(admin.ModelAdmin):
|
|
model = Controlling
|
|
|
|
def get_urls(self):
|
|
view_name = '{}_{}_changelist'.format(
|
|
self.model._meta.app_label, self.model._meta.model_name)
|
|
return [
|
|
path('my_admin_path/', my_custom_view, name=view_name),
|
|
]
|
|
|
|
|
|
#admin.site.register(Controlling, ControllingAdmin)
|
|
#admin.autodiscover()
|