2👍
✅
Use forms.ModelForm
to override the init
class YourForm(forms.ModelForm):
amount = forms.FloatField()
def __init__(self, *args, **kwargs):
super(YourForm, self).__init__(*args, **kwargs)
self.fields['amount'].widget = forms.HiddenInput()
self.fields['amount'].initial = ''
Source:stackexchange.com