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()

所有评论(0)