mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-13 16:22:42 +02:00
Merge pull request #174
feat(insights:category-explorer): allow for uncategorized totals
This commit is contained in:
@@ -9,6 +9,7 @@ from apps.common.widgets.datepicker import (
|
|||||||
AirDatePickerInput,
|
AirDatePickerInput,
|
||||||
)
|
)
|
||||||
from apps.transactions.models import TransactionCategory
|
from apps.transactions.models import TransactionCategory
|
||||||
|
from apps.common.widgets.tom_select import TomSelect
|
||||||
|
|
||||||
|
|
||||||
class SingleMonthForm(forms.Form):
|
class SingleMonthForm(forms.Form):
|
||||||
@@ -115,7 +116,9 @@ class CategoryForm(forms.Form):
|
|||||||
category = forms.ModelChoiceField(
|
category = forms.ModelChoiceField(
|
||||||
required=False,
|
required=False,
|
||||||
label=_("Category"),
|
label=_("Category"),
|
||||||
|
empty_label=_("Uncategorized"),
|
||||||
queryset=TransactionCategory.objects.filter(active=True),
|
queryset=TransactionCategory.objects.filter(active=True),
|
||||||
|
widget=TomSelect(clear_button=True),
|
||||||
)
|
)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ def category_sum_by_account(request):
|
|||||||
# Generate data
|
# Generate data
|
||||||
account_data = get_category_sums_by_account(transactions, category)
|
account_data = get_category_sums_by_account(transactions, category)
|
||||||
else:
|
else:
|
||||||
account_data = None
|
account_data = get_category_sums_by_account(transactions, category=None)
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
@@ -150,9 +150,7 @@ def category_sum_by_currency(request):
|
|||||||
# Generate data
|
# Generate data
|
||||||
currency_data = get_category_sums_by_currency(transactions, category)
|
currency_data = get_category_sums_by_currency(transactions, category)
|
||||||
else:
|
else:
|
||||||
currency_data = None
|
currency_data = get_category_sums_by_currency(transactions, category=None)
|
||||||
|
|
||||||
print(currency_data)
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
|
|||||||
Reference in New Issue
Block a user