parent
d246843be0
commit
608da4be55
2 changed files with 3 additions and 3 deletions
|
@ -6,10 +6,10 @@ register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
@register.inclusion_tag("category/category_plot.html", takes_context=True)
|
@register.inclusion_tag("category/category_plot.html", takes_context=True)
|
||||||
def category_plot(context, transactions, budget=True, **kwargs):
|
def category_plot(context, transactions, **kwargs):
|
||||||
kwargs.setdefault("account", context.get("account"))
|
kwargs.setdefault("account", context.get("account"))
|
||||||
|
|
||||||
if budget:
|
if not kwargs.get("account"):
|
||||||
transactions = transactions.exclude(category__budget=False)
|
transactions = transactions.exclude(category__budget=False)
|
||||||
categories = (
|
categories = (
|
||||||
transactions.values("category", "category__name", "category__icon")
|
transactions.values("category", "category__name", "category__icon")
|
||||||
|
|
|
@ -65,6 +65,6 @@
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<h3>{% translate "Categories" %}</h3>
|
<h3>{% translate "Categories" %}</h3>
|
||||||
{% category_plot transactions budget=False statement=object %}
|
{% category_plot transactions statement=object %}
|
||||||
</section>
|
</section>
|
||||||
{% endblock body %}
|
{% endblock body %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue