Example #1
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 #2
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 #3
0
    class Meta:
        model = models.Product
        localized_fields = ('price_valid_until',)
        fields = ['name', 'description', 'gender', 'price_ht', 'discount_pct', 'quantity', 'price_valid_until',
                  'collection', 'clothe_size', 'reference', 'sku', 'in_stock', 'active', 'our_favorite', 'discounted', 'google_category']
        widgets = {
            'name': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'Nom du produit'}),
            'description': forms.widgets.Textarea(attrs={'class': 'form-control'}),
            'gender': widgets.Select(attrs={'class': 'form-control'}),

            'sku': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'SKU'}),
            'reference': widgets.TextInput(attrs={'class': 'form-control', 'placeholder': 'Référence'}),

            'price_ht': widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Prix Hors Taxe', 'min': '0'}),
            'price_valid_until': custom_widgets.DateInput(),
            'discount_pct': widgets.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Nombre en %', 'min': '5'}),
            'quantity': widgets.NumberInput(attrs={'class': 'form-control', 'step': '5', 'min': '0'}),

            'clothe_size': widgets.SelectMultiple(attrs={'class': 'form-control'}),
            'collection': widgets.Select(attrs={'class': 'form-control'}),
            'google_category': widgets.Select(attrs={'class': 'form-control'}),

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