class ImageForm forms ModelForm class Meta model ImageStore def __init

1
2
3
4
5
6
7
8
9
class ImageForm(forms.ModelForm):
class Meta:
model = ImageStore
def __init__(self, product=None, *args, **kwargs):
super(ImageForm, self).__init__(*args, **kwargs)
if product is not None:
self.product = product
self.fields['product'].widget = forms.widgets.HiddenInput()