Example #1
0
    class Meta:
        model = models.Product
        localized_fields = ('price_valid_until',)
        exclude = ['images', 'variant', 'slug', 'last_modified', 'created_on']
        widgets = {
            'name': custom_widgets.TextInput(attrs={'placeholder': 'Nom du produit'}),
            'description': forms.widgets.Textarea(attrs={'class': 'form-control'}),
            'gender': widgets.Select(attrs={'class': 'form-control'}),

            'sku': custom_widgets.TextInput(attrs={'placeholder': 'SKU'}),
            'reference': custom_widgets.TextInput(attrs={'placeholder': 'Référence'}),
            
            'price_pre_tax': custom_widgets.NumberInput(attrs={'placeholder': 'Prix Hors Taxe', 'min': '0', 'step': 'any'}),
            'price_valid_until': custom_widgets.DateInput(),
            'discount_pct': custom_widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Nombre en %', 'min': '5'}),
            'quantity': custom_widgets.NumberInput(attrs={'class': 'form-control', 'step': '5', 'min': '0'}),
            
            'collection': widgets.Select(attrs={'class': 'form-control'}),
            'google_category': widgets.Select(attrs={'class': 'form-control'}),

            'in_stock': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),
            'our_favorite': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),
            'discounted': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),
            'active': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),
            'private': widgets.CheckboxInput(attrs={'class': 'custom-control-input'}),

            'to_be_published_on': custom_widgets.DateInput()
        }
Example #2
0
 class Meta:
     model = models.Image
     fields = ['name', 'url', 'variant', 'main_image']
     widgets = {
         'name': custom_widgets.TextInput(attrs={'placeholder': 'Name'}),
         'url': custom_widgets.TextInput(attrs={'placeholder': 'Url'}),
         'variant': custom_widgets.TextInput(attrs={'placeholder': 'Variant'}),
         'main_image': custom_widgets.CheckBoxInput()
     }
Example #3
0
    class Meta:
        model = models.CustomerOrder
        fields = ['accepted', 'shipped',
                  'completed', 'refund', 'tracking_number']

        widgets = {
            'accepted': custom_widgets.CheckBoxInput(),
            'completed': custom_widgets.CheckBoxInput(),
            'refund': custom_widgets.CheckBoxInput(),
            'shipped': custom_widgets.CheckBoxInput(),
            'delivery': custom_widgets.TextInput(),
            'tracking_number': custom_widgets.TextInput(),
        }
Example #4
0
 class Meta:
     model = dashboard_models.DashboardSetting
     fields = [
         'name', 'contact_email', 'customer_care_email',
         'automatic_archive', 'allow_coupons', 'legal_name', 'telephone'
     ]
     widgets = {
         'name': custom_widgets.TextInput(),
         'contact_email': custom_widgets.EmailInput(),
         'customer_care_email': custom_widgets.EmailInput(),
         'automatic_archive': custom_widgets.CheckBoxInput(),
         'legal_name': custom_widgets.TextInput(),
         'telephone': custom_widgets.TextInput(),
     }
Example #5
0
    class Meta:
        model = models.Discount
        fields = ['code', 'value_type', 'value', 'collection', 'on_entire_order',\
         'minimum_purchase', 'minimum_quantity', 'usage_limit', 'start_date', 'end_date']

        widgets = {
            'code':
            custom_widgets.TextInput(attrs={'placeholder': 'Code'}),
            'value_type':
            widgets.Select(attrs={'class': 'form-control'}),
            'value':
            custom_widgets.NumberInput(
                attrs={'v-model': "fieldsdata['value']"}),
            'collection':
            widgets.Select(attrs={'class': 'form-control'}),
            'on_entire_order':
            widgets.CheckboxInput(),
            'minimum_purchase':
            custom_widgets.NumberInput(),
            'minimum_quantity':
            custom_widgets.NumberInput(),
            'usage_limit':
            custom_widgets.NumberInput(),
            'start_date':
            custom_widgets.DateInput(),
            'end_date':
            custom_widgets.DateInput(),
        }
Example #6
0
    class Meta:
        model = get_user_model()
        fields = ['name', 'surname', 'email']

        widgets = {
            'name': custom_widgets.TextInput(attrs={'placeholder': 'Nom'}),
        }
Example #7
0
    class Meta:
        model = models.Collection
        fields = ['name', 'presentation_text']

        widgets = {
            'name': custom_widgets.TextInput(attrs={'placeholder': 'Nom de la collection'}),
            'presentation_text': forms.widgets.Textarea(attrs={'class': 'form-control'}),
        }
Example #8
0
    class Meta:
        model = models.Collection
        fields = ['name', 'image', 'presentation_text', 'google_description', 'show_presentation']

        widgets = {
            'name': custom_widgets.TextInput(attrs={'placeholder': 'Nom de la collection'}),
            'presentation_text': forms.widgets.Textarea(attrs={'class': 'form-control'}),
            'image': custom_widgets.CustomFileInput(),
        }
Example #9
0
 class Meta:
     model = dashboard_models.DashboardSetting
     fields = [
         'google_analytics', 'google_tag_manager', 'google_optimize',
         'google_ads', 'facebook_pixels', 'mailchimp'
     ]
     widgets = {
         'google_analytics': custom_widgets.TextInput(),
         'google_tag_manager': custom_widgets.TextInput(),
         'google_optimize': custom_widgets.TextInput(),
         'google_ads': custom_widgets.TextInput(),
         'facebook_pixels': custom_widgets.TextInput(),
         'mailchimp': custom_widgets.TextInput(),
     }