Compare commits
2 commits
94671b9ac4
...
6b54cc7546
Author | SHA1 | Date | |
---|---|---|---|
6b54cc7546 | |||
1536e7f674 |
2 changed files with 26 additions and 14 deletions
|
@ -19,8 +19,12 @@
|
|||
{% csrf_token %}
|
||||
{{ form }}
|
||||
</form>
|
||||
{% if snapshots %}
|
||||
<h2>{% translate "Statements" %}</h2>
|
||||
{% include "main/table/snapshot.html" %}
|
||||
{% endif %}
|
||||
{% if transactions %}
|
||||
<h2>{% translate "Transactions" %}</h2>
|
||||
{% include "main/table/transaction.html" %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -241,15 +241,7 @@ class AccountMixin:
|
|||
}
|
||||
|
||||
|
||||
class AccountTListView(AccountMixin, TransactionListView):
|
||||
pass
|
||||
|
||||
|
||||
class AccountSListView(AccountMixin, SnapshotListView):
|
||||
pass
|
||||
|
||||
|
||||
class SnapshotTListView(TransactionListView):
|
||||
class SnapshotMixin:
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(snapshot=self.kwargs.get("pk"))
|
||||
|
||||
|
@ -259,7 +251,7 @@ class SnapshotTListView(TransactionListView):
|
|||
}
|
||||
|
||||
|
||||
class CategoryTListView(TransactionListView):
|
||||
class CategoryMixin:
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(category=self.kwargs.get("pk"))
|
||||
|
||||
|
@ -269,6 +261,22 @@ class CategoryTListView(TransactionListView):
|
|||
}
|
||||
|
||||
|
||||
class AccountTListView(AccountMixin, TransactionListView):
|
||||
pass
|
||||
|
||||
|
||||
class AccountSListView(AccountMixin, SnapshotListView):
|
||||
pass
|
||||
|
||||
|
||||
class SnapshotTListView(SnapshotMixin, TransactionListView):
|
||||
pass
|
||||
|
||||
|
||||
class CategoryTListView(CategoryMixin, TransactionListView):
|
||||
pass
|
||||
|
||||
|
||||
class SearchView(TransactionListView):
|
||||
def post(self, *args, **kwargs):
|
||||
return redirect("search", search=self.request.POST.get("search"))
|
||||
|
|
Loading…
Reference in a new issue