Compare commits

..

No commits in common. "6b54cc7546aa11ceaab8927371867fe878920a3e" and "94671b9ac4512b14caaa511285bbf1050d08ae31" have entirely different histories.

2 changed files with 14 additions and 26 deletions

View File

@ -19,12 +19,8 @@
{% csrf_token %} {% csrf_token %}
{{ form }} {{ form }}
</form> </form>
{% if snapshots %}
<h2>{% translate "Statements" %}</h2> <h2>{% translate "Statements" %}</h2>
{% include "main/table/snapshot.html" %} {% include "main/table/snapshot.html" %}
{% endif %}
{% if transactions %}
<h2>{% translate "Transactions" %}</h2> <h2>{% translate "Transactions" %}</h2>
{% include "main/table/transaction.html" %} {% include "main/table/transaction.html" %}
{% endif %}
{% endblock %} {% endblock %}

View File

@ -241,7 +241,15 @@ class AccountMixin:
} }
class SnapshotMixin: class AccountTListView(AccountMixin, TransactionListView):
pass
class AccountSListView(AccountMixin, SnapshotListView):
pass
class SnapshotTListView(TransactionListView):
def get_queryset(self): def get_queryset(self):
return super().get_queryset().filter(snapshot=self.kwargs.get("pk")) return super().get_queryset().filter(snapshot=self.kwargs.get("pk"))
@ -251,7 +259,7 @@ class SnapshotMixin:
} }
class CategoryMixin: class CategoryTListView(TransactionListView):
def get_queryset(self): def get_queryset(self):
return super().get_queryset().filter(category=self.kwargs.get("pk")) return super().get_queryset().filter(category=self.kwargs.get("pk"))
@ -261,22 +269,6 @@ class CategoryMixin:
} }
class AccountTListView(AccountMixin, TransactionListView):
pass
class AccountSListView(AccountMixin, SnapshotListView):
pass
class SnapshotTListView(SnapshotMixin, TransactionListView):
pass
class CategoryTListView(CategoryMixin, TransactionListView):
pass
class SearchView(TransactionListView): class SearchView(TransactionListView):
def post(self, *args, **kwargs): def post(self, *args, **kwargs):
return redirect("search", search=self.request.POST.get("search")) return redirect("search", search=self.request.POST.get("search"))