django-model-stats

Display how often models and model fields are used in the database
git clone https://git.ce9e.org/django-model-stats.git

commit
a551222fd0c69c79e6d71a452b74aae694087709
parent
521689ca07bb0032d2ffa35cc9521f4f81dc389d
Author
Tobias Bengfort <bengfort@mpib-berlin.mpg.de>
Date
2021-11-03 12:06
add staff_member_required

Diffstat

M CHANGES.md 2 +-
M model_stats/views.py 2 ++

2 files changed, 3 insertions, 1 deletions


diff --git a/CHANGES.md b/CHANGES.md

@@ -1,4 +1,4 @@
    1     1 0.0.0 (2021-11-03)
    2     2 ------------------
    3     3 
    4    -1 initial relase
   -1     4 initial release

diff --git a/model_stats/views.py b/model_stats/views.py

@@ -1,4 +1,5 @@
    1     1 from django.template.response import TemplateResponse
   -1     2 from django.contrib.admin.views.decorators import staff_member_required
    2     3 from django.contrib.contenttypes.models import ContentType
    3     4 from django.contrib.contenttypes.fields import GenericForeignKey
    4     5 
@@ -41,6 +42,7 @@ def get_stats():
   41    42         }
   42    43 
   43    44 
   -1    45 @staff_member_required
   44    46 def stats_view(request):
   45    47     context = {'stats': get_stats()}
   46    48     return TemplateResponse(request, 'model_stats/stats.html', context)