parent
c14e075cad
commit
5b49836bad
4 changed files with 10 additions and 6 deletions
|
@ -22,6 +22,6 @@
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h3>{% translate "History" %}</h3>
|
<h3>{% translate "History" %}</h3>
|
||||||
{% history_plot account.transactions %}
|
{% history_plot account.transactions account=account %}
|
||||||
</section>
|
</section>
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
|
@ -20,6 +20,6 @@
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h3>{% translate "History" %}</h3>
|
<h3>{% translate "History" %}</h3>
|
||||||
{% history_plot category.transaction_set.all %}
|
{% history_plot category.transaction_set category=category %}
|
||||||
</section>
|
</section>
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
|
@ -10,9 +10,13 @@ register = template.Library()
|
||||||
|
|
||||||
@register.inclusion_tag("history/plot.html")
|
@register.inclusion_tag("history/plot.html")
|
||||||
def history_plot(transactions, **kwargs):
|
def history_plot(transactions, **kwargs):
|
||||||
return kwargs | {
|
options = kwargs
|
||||||
"history": history(transactions.exclude(category__budget=False)),
|
if "category" in kwargs or "account" in kwargs:
|
||||||
}
|
options["history"] = history(transactions.all())
|
||||||
|
else:
|
||||||
|
options["history"] = history(transactions.exclude(category__budget=False))
|
||||||
|
|
||||||
|
return options
|
||||||
|
|
||||||
|
|
||||||
@register.simple_tag
|
@register.simple_tag
|
||||||
|
|
|
@ -136,7 +136,7 @@ class TransactionACMixin:
|
||||||
Account.objects.filter(user=self.request.user),
|
Account.objects.filter(user=self.request.user),
|
||||||
pk=self.kwargs["account"],
|
pk=self.kwargs["account"],
|
||||||
)
|
)
|
||||||
return super().get_queryset().filter(account=self.account)
|
return super().get_queryset().filter(statement__account=self.account)
|
||||||
if "category" in self.kwargs:
|
if "category" in self.kwargs:
|
||||||
self.category = get_object_or_404(
|
self.category = get_object_or_404(
|
||||||
Category.objects.filter(user=self.request.user),
|
Category.objects.filter(user=self.request.user),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue