Example #1
0
    def __init__(self, *args, **kwargs):
        super(CategoryForm, self).__init__(*args, **kwargs)
        self.fields["image"].widget = LFSImageInput()

        try:
            context = kwargs["instance"]
        except KeyError:
            context = None
Example #2
0
    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)
Example #3
0
 def __init__(self, *args, **kwargs):
     super(ShopDataForm, self).__init__(*args, **kwargs)
     self.fields["image"].widget = LFSImageInput()
Example #4
0
 def __init__(self, *args, **kwargs):
     super(PaymentMethodForm, self).__init__(*args, **kwargs)
     self.fields["image"].widget = LFSImageInput()