mirror of
https://github.com/jointakahe/takahe.git
synced 2024-11-29 02:31:00 +00:00
19 lines
583 B
Python
19 lines
583 B
Python
from django.utils.decorators import method_decorator
|
|
from django.views.generic import TemplateView
|
|
|
|
from stator.models import StatorModel, Stats
|
|
from users.decorators import admin_required
|
|
|
|
|
|
@method_decorator(admin_required, name="dispatch")
|
|
class Stator(TemplateView):
|
|
template_name = "admin/stator.html"
|
|
|
|
def get_context_data(self):
|
|
return {
|
|
"model_stats": {
|
|
model._meta.verbose_name_plural.title(): Stats.get_for_model(model)
|
|
for model in StatorModel.subclasses
|
|
},
|
|
"section": "stator",
|
|
}
|