Add back link to list pages
This commit is contained in:
parent
39896129a6
commit
94671b9ac4
3 changed files with 17 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
|||
{% endblock %}
|
||||
{% block body %}
|
||||
<h1>{% translate "Statements" %}</h1>
|
||||
{% if object %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% endif %}
|
||||
{% if snapshots %}
|
||||
{% include "main/table/snapshot.html" %}
|
||||
{% if page_obj %}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
{% endblock %}
|
||||
{% block body %}
|
||||
<h1>{% translate "Transactions" %}</h1>
|
||||
{% if object %}<a href="{{ object.get_absolute_url }}">{{ object }}</a>{% endif %}
|
||||
{% if transactions %}
|
||||
{% include "main/table/transaction.html" %}
|
||||
{% if page_obj %}
|
||||
|
|
|
@ -235,6 +235,11 @@ class AccountMixin:
|
|||
def get_queryset(self):
|
||||
return super().get_queryset().filter(account=self.kwargs.get("pk"))
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return super().get_context_data(**kwargs) | {
|
||||
"object": Account.objects.get(pk=self.kwargs.get("pk"))
|
||||
}
|
||||
|
||||
|
||||
class AccountTListView(AccountMixin, TransactionListView):
|
||||
pass
|
||||
|
@ -248,11 +253,21 @@ class SnapshotTListView(TransactionListView):
|
|||
def get_queryset(self):
|
||||
return super().get_queryset().filter(snapshot=self.kwargs.get("pk"))
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return super().get_context_data(**kwargs) | {
|
||||
"object": Snapshot.objects.get(pk=self.kwargs.get("pk"))
|
||||
}
|
||||
|
||||
|
||||
class CategoryTListView(TransactionListView):
|
||||
def get_queryset(self):
|
||||
return super().get_queryset().filter(category=self.kwargs.get("pk"))
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
return super().get_context_data(**kwargs) | {
|
||||
"object": Category.objects.get(pk=self.kwargs.get("pk"))
|
||||
}
|
||||
|
||||
|
||||
class SearchView(TransactionListView):
|
||||
def post(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in a new issue