You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
937 B
22 lines
937 B
from django import forms
|
|
from .models import Coupon
|
|
from .models import ShippingAddress
|
|
|
|
class GuestCheckoutForm(forms.Form):
|
|
email = forms.EmailField(required=True)
|
|
phone = forms.CharField(max_length=20, required=True, label="Téléphone portable")
|
|
|
|
class CouponApplyForm(forms.Form):
|
|
code = forms.CharField(max_length=50)
|
|
|
|
class ShippingAddressForm(forms.ModelForm):
|
|
class Meta:
|
|
model = ShippingAddress
|
|
fields = ['street_address', 'apartment', 'city', 'postal_code', 'country']
|
|
widgets = {
|
|
'street_address': forms.TextInput(attrs={'placeholder': 'Adresse'}),
|
|
'apartment': forms.TextInput(attrs={'placeholder': 'Appartement (optionnel)'}),
|
|
'city': forms.TextInput(attrs={'placeholder': 'Ville'}),
|
|
'postal_code': forms.TextInput(attrs={'placeholder': 'Code postal'}),
|
|
'country': forms.TextInput(attrs={'placeholder': 'Pays'}),
|
|
}
|
|
|