1👍
Assuming you are talking about a ModelForm, you cannot override the fields inside the Meta
class. It must be outside.
Also, if the field is required in the model but not in the form, then you must provide a default value, like this:
class LocatorForm:
patient_signature = forms.CharField(widget=forms.HiddenInput(), initial=" ")
class Meta:
...
Alternatively, do not mention that field in the fields
list and set a value by overriding the submission of the form’s POST.
0👍
patient_signature=forms.CharField(widget=ClientSignatureWidget(), required=False)
- [Answer]-Keep User authenticated using Django Rest and Phonegap?
- [Answer]-Django capturing query parameters
- [Answer]-Couldnt install Openstack-Devstack on DigitalOcean
- [Answer]-How to deserialize foreignkey with django rest framework?
- [Answer]-Why do I not see Django exceptions in the browser under OpenShift?
Source:stackexchange.com