Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     super(ShopDataForm, self).__init__(*args, **kwargs)
     self.fields["image"].widget = LFSImageInput()
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(PaymentMethodForm, self).__init__(*args, **kwargs)
     self.fields["image"].widget = LFSImageInput()