def __init__(self, *args, **kwargs): super(CategoryForm, self).__init__(*args, **kwargs) self.fields["image"].widget = LFSImageInput() try: context = kwargs["instance"] except KeyError: context = None
def __init__(self, *args, **kwargs): super(CategoryForm, self).__init__(*args, **kwargs) self.fields["image"].widget = LFSImageInput() # If it is used as add form there is no instance. try: context = kwargs["instance"] except KeyError: context = None self.fields["parent"].choices = _category_choices(context)
def __init__(self, *args, **kwargs): super(ShopDataForm, self).__init__(*args, **kwargs) self.fields["image"].widget = LFSImageInput()
def __init__(self, *args, **kwargs): super(PaymentMethodForm, self).__init__(*args, **kwargs) self.fields["image"].widget = LFSImageInput()