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
22f1edfc3c14b049c1e732f4dfdaf09d2db09f4c
parent
1c16b1147774dbd68a73ac87702fc8ad5d9d3f08
Author
Tobias Bengfort <bengfort@mpib-berlin.mpg.de>
Date
2021-11-03 11:00
add view

Diffstat

A model_stats/__init__.py 0
A model_stats/templates/model_stats/stats.html 15 +++++++++++++++
A model_stats/urls.py 7 +++++++
A model_stats/views.py 6 ++++++

4 files changed, 28 insertions, 0 deletions


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

diff --git a/model_stats/templates/model_stats/stats.html b/model_stats/templates/model_stats/stats.html

@@ -0,0 +1,15 @@
   -1     1 {% extends "admin/base_site.html" %}
   -1     2 {% load i18n %}
   -1     3 
   -1     4 {% block title %}{% translate 'Model Stats' %} {{ block.super }}{% endblock %}
   -1     5 
   -1     6 {% block breadcrumbs %}
   -1     7     <div class="breadcrumbs">
   -1     8         <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
   -1     9         &rsaquo;
   -1    10         <a href="{% url 'model-stats' %}">{% translate 'Stats' %}</a>
   -1    11     </div>
   -1    12 {% endblock %}
   -1    13 
   -1    14 {% block content %}
   -1    15 {% endblock %}

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

@@ -0,0 +1,7 @@
   -1     1 from django.urls import path
   -1     2 
   -1     3 from .views import stats_view
   -1     4 
   -1     5 urlpatterns = [
   -1     6     path('', stats_view, name='model-stats'),
   -1     7 ]

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

@@ -0,0 +1,6 @@
   -1     1 from django.template.response import TemplateResponse
   -1     2 
   -1     3 
   -1     4 def stats_view(request):
   -1     5     context = {}
   -1     6     return TemplateResponse(request, 'model_stats/stats.html', context)