mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-10 14:52:42 +02:00
fix: tomselect widget not getting initialized correctly
This commit is contained in:
@@ -46,6 +46,7 @@ class TransactionForm(forms.ModelForm):
|
|||||||
account = GroupedModelChoiceField(
|
account = GroupedModelChoiceField(
|
||||||
queryset=Account.objects.all(),
|
queryset=Account.objects.all(),
|
||||||
group_by="group",
|
group_by="group",
|
||||||
|
widget=TomSelect(clear_button=False),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
@@ -65,7 +66,6 @@ class TransactionForm(forms.ModelForm):
|
|||||||
widgets = {
|
widgets = {
|
||||||
"date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
"date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
||||||
"notes": forms.Textarea(attrs={"rows": 3}),
|
"notes": forms.Textarea(attrs={"rows": 3}),
|
||||||
"account": TomSelect(),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -136,13 +136,13 @@ class TransferForm(forms.Form):
|
|||||||
queryset=Account.objects.all(),
|
queryset=Account.objects.all(),
|
||||||
group_by="group",
|
group_by="group",
|
||||||
label=_("From Account"),
|
label=_("From Account"),
|
||||||
widget=TomSelect(),
|
widget=TomSelect(clear_button=False),
|
||||||
)
|
)
|
||||||
to_account = GroupedModelChoiceField(
|
to_account = GroupedModelChoiceField(
|
||||||
queryset=Account.objects.all(),
|
queryset=Account.objects.all(),
|
||||||
group_by="group",
|
group_by="group",
|
||||||
label=_("To Account"),
|
label=_("To Account"),
|
||||||
widget=TomSelect(),
|
widget=TomSelect(clear_button=False),
|
||||||
)
|
)
|
||||||
|
|
||||||
from_amount = forms.DecimalField(
|
from_amount = forms.DecimalField(
|
||||||
@@ -314,7 +314,7 @@ class InstallmentPlanForm(forms.ModelForm):
|
|||||||
account = GroupedModelChoiceField(
|
account = GroupedModelChoiceField(
|
||||||
queryset=Account.objects.all(),
|
queryset=Account.objects.all(),
|
||||||
group_by="group",
|
group_by="group",
|
||||||
widget=TomSelect(),
|
widget=TomSelect(clear_button=False),
|
||||||
)
|
)
|
||||||
tags = DynamicModelMultipleChoiceField(
|
tags = DynamicModelMultipleChoiceField(
|
||||||
model=TransactionTag,
|
model=TransactionTag,
|
||||||
@@ -487,7 +487,7 @@ class RecurringTransactionForm(forms.ModelForm):
|
|||||||
account = GroupedModelChoiceField(
|
account = GroupedModelChoiceField(
|
||||||
queryset=Account.objects.all(),
|
queryset=Account.objects.all(),
|
||||||
group_by="group",
|
group_by="group",
|
||||||
widget=TomSelect(),
|
widget=TomSelect(clear_button=False),
|
||||||
)
|
)
|
||||||
tags = DynamicModelMultipleChoiceField(
|
tags = DynamicModelMultipleChoiceField(
|
||||||
model=TransactionTag,
|
model=TransactionTag,
|
||||||
@@ -522,7 +522,6 @@ class RecurringTransactionForm(forms.ModelForm):
|
|||||||
widgets = {
|
widgets = {
|
||||||
"start_date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
"start_date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
||||||
"end_date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
"end_date": forms.DateInput(attrs={"type": "date"}, format="%Y-%m-%d"),
|
||||||
"account": TomSelect(clear_button=False),
|
|
||||||
"recurrence_type": TomSelect(clear_button=False),
|
"recurrence_type": TomSelect(clear_button=False),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user