I have a custom form that creates a hidden input of a field:
class MPForm( forms.ModelForm ):
def __init__( self, *args, **kwargs ):
super(MPForm, self).__init__( *args, **kwargs )
self.fields['mp_e'].label = "" #the trick :)
class Meta:
model = MeasurementPoint
widgets = { 'mp_e': forms.HiddenInput() }
exclude = ('mp_order')
I have to do this little trick to "hide" the label, but what I want to do is remove it from the form. I create the form like this:
forms.MPForm()
Now,(my django version is 2.1.4), you can solve in this way -> Edit forms.py file:
password = forms.CharField(label=False)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With