Move history to separate app

This commit is contained in:
Edgar P. Burkhart 2023-04-22 13:53:45 +02:00
parent f0a232f366
commit 2d5f209c41
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
12 changed files with 13 additions and 6 deletions

View file

@ -18,7 +18,7 @@
<h3>{% translate "Transactions" %}</h3> <h3>{% translate "Transactions" %}</h3>
{% include "transaction/transaction_table.html" %} {% include "transaction/transaction_table.html" %}
<h3>{% translate "History" %}</h3> <h3>{% translate "History" %}</h3>
{% include "transaction/history_plot.html" %} {% include "history/plot.html" %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -1,8 +1,8 @@
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy from django.urls import reverse_lazy
from history.utils import history
from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView
from statement.views import StatementListView from statement.views import StatementListView
from transaction.utils import history
from transaction.views import TransactionListView from transaction.views import TransactionListView
from .forms import AccountForm from .forms import AccountForm

View file

@ -15,6 +15,6 @@
{% endif %} {% endif %}
{% if history.data %} {% if history.data %}
<h3>{% translate "History" %}</h3> <h3>{% translate "History" %}</h3>
{% include "transaction/history_plot.html" %} {% include "history/plot.html" %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -1,7 +1,7 @@
from django.shortcuts import get_object_or_404 from django.shortcuts import get_object_or_404
from django.urls import reverse_lazy from django.urls import reverse_lazy
from history.utils import history
from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView from main.views import NummiCreateView, NummiDeleteView, NummiUpdateView
from transaction.utils import history
from transaction.views import TransactionListView from transaction.views import TransactionListView
from .forms import CategoryForm from .forms import CategoryForm

View file

6
nummi/history/apps.py Normal file
View file

@ -0,0 +1,6 @@
from django.apps import AppConfig
class HistoryConfig(AppConfig):
default_auto_field = "django.db.models.BigAutoField"
name = "history"

View file

View file

@ -42,6 +42,6 @@
{% endif %} {% endif %}
{% if history.data %} {% if history.data %}
<h2>{% translate "History" %}</h2> <h2>{% translate "History" %}</h2>
{% include "transaction/history_plot.html" %} {% include "history/plot.html" %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}

View file

@ -10,9 +10,9 @@ from django.views.generic import (
TemplateView, TemplateView,
UpdateView, UpdateView,
) )
from history.utils import history
from statement.models import Statement from statement.models import Statement
from transaction.models import Transaction from transaction.models import Transaction
from transaction.utils import history
class IndexView(LoginRequiredMixin, TemplateView): class IndexView(LoginRequiredMixin, TemplateView):

View file

@ -51,6 +51,7 @@ INSTALLED_APPS = [
"statement", "statement",
"transaction", "transaction",
"search", "search",
"history",
"django.contrib.admin", "django.contrib.admin",
"django.contrib.auth", "django.contrib.auth",
"django.contrib.contenttypes", "django.contrib.contenttypes",