From 2d5f209c41ca5800c2dd1c1bad21bed86a523425 Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 22 Apr 2023 13:53:45 +0200 Subject: [PATCH] Move history to separate app --- nummi/account/templates/account/account_form.html | 2 +- nummi/account/views.py | 2 +- nummi/category/templates/category/category_form.html | 2 +- nummi/category/views.py | 2 +- nummi/history/__init__.py | 0 nummi/history/apps.py | 6 ++++++ nummi/history/migrations/__init__.py | 0 .../templates/history/plot.html} | 0 nummi/{transaction => history}/utils.py | 0 nummi/main/templates/main/index.html | 2 +- nummi/main/views.py | 2 +- nummi/nummi/settings.py | 1 + 12 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 nummi/history/__init__.py create mode 100644 nummi/history/apps.py create mode 100644 nummi/history/migrations/__init__.py rename nummi/{transaction/templates/transaction/history_plot.html => history/templates/history/plot.html} (100%) rename nummi/{transaction => history}/utils.py (100%) diff --git a/nummi/account/templates/account/account_form.html b/nummi/account/templates/account/account_form.html index 91cd0af..bb9f369 100644 --- a/nummi/account/templates/account/account_form.html +++ b/nummi/account/templates/account/account_form.html @@ -18,7 +18,7 @@

{% translate "Transactions" %}

{% include "transaction/transaction_table.html" %}

{% translate "History" %}

- {% include "transaction/history_plot.html" %} + {% include "history/plot.html" %} {% endif %} {% endif %} {% endblock %} diff --git a/nummi/account/views.py b/nummi/account/views.py index a73c7a8..446ac30 100644 --- a/nummi/account/views.py +++ b/nummi/account/views.py @@ -1,8 +1,8 @@ from django.shortcuts import get_object_or_404 from django.urls import reverse_lazy +from history.utils import history from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView from statement.views import StatementListView -from transaction.utils import history from transaction.views import TransactionListView from .forms import AccountForm diff --git a/nummi/category/templates/category/category_form.html b/nummi/category/templates/category/category_form.html index d995b04..b97f71b 100644 --- a/nummi/category/templates/category/category_form.html +++ b/nummi/category/templates/category/category_form.html @@ -15,6 +15,6 @@ {% endif %} {% if history.data %}

{% translate "History" %}

- {% include "transaction/history_plot.html" %} + {% include "history/plot.html" %} {% endif %} {% endblock %} diff --git a/nummi/category/views.py b/nummi/category/views.py index 53d8609..2e2fc1c 100644 --- a/nummi/category/views.py +++ b/nummi/category/views.py @@ -1,7 +1,7 @@ from django.shortcuts import get_object_or_404 from django.urls import reverse_lazy +from history.utils import history from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView -from transaction.utils import history from transaction.views import TransactionListView from .forms import CategoryForm diff --git a/nummi/history/__init__.py b/nummi/history/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nummi/history/apps.py b/nummi/history/apps.py new file mode 100644 index 0000000..af5c1f4 --- /dev/null +++ b/nummi/history/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HistoryConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "history" diff --git a/nummi/history/migrations/__init__.py b/nummi/history/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/nummi/transaction/templates/transaction/history_plot.html b/nummi/history/templates/history/plot.html similarity index 100% rename from nummi/transaction/templates/transaction/history_plot.html rename to nummi/history/templates/history/plot.html diff --git a/nummi/transaction/utils.py b/nummi/history/utils.py similarity index 100% rename from nummi/transaction/utils.py rename to nummi/history/utils.py diff --git a/nummi/main/templates/main/index.html b/nummi/main/templates/main/index.html index 9da7a05..5f194d8 100644 --- a/nummi/main/templates/main/index.html +++ b/nummi/main/templates/main/index.html @@ -42,6 +42,6 @@ {% endif %} {% if history.data %}

{% translate "History" %}

- {% include "transaction/history_plot.html" %} + {% include "history/plot.html" %} {% endif %} {% endblock %} diff --git a/nummi/main/views.py b/nummi/main/views.py index e7fbea9..8095486 100644 --- a/nummi/main/views.py +++ b/nummi/main/views.py @@ -10,9 +10,9 @@ from django.views.generic import ( TemplateView, UpdateView, ) +from history.utils import history from statement.models import Statement from transaction.models import Transaction -from transaction.utils import history class IndexView(LoginRequiredMixin, TemplateView): diff --git a/nummi/nummi/settings.py b/nummi/nummi/settings.py index 28af502..d1cd960 100644 --- a/nummi/nummi/settings.py +++ b/nummi/nummi/settings.py @@ -51,6 +51,7 @@ INSTALLED_APPS = [ "statement", "transaction", "search", + "history", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes",