add requiered field
This commit is contained in:
parent
c76de99e84
commit
001dc313f6
6 changed files with 42 additions and 35 deletions
|
|
@ -64,21 +64,25 @@ class CustomerForm(forms.ModelForm):
|
|||
'address': forms.Textarea(attrs={
|
||||
'class': 'form-control',
|
||||
'placeholder': 'آدرس کامل',
|
||||
'rows': '3'
|
||||
'rows': '3',
|
||||
'required': True
|
||||
}),
|
||||
'card_number': forms.TextInput(attrs={
|
||||
'class': 'form-control',
|
||||
'placeholder': 'شماره کارت بانکی',
|
||||
'maxlength': '16'
|
||||
'maxlength': '16',
|
||||
'required': True
|
||||
}),
|
||||
'account_number': forms.TextInput(attrs={
|
||||
'class': 'form-control',
|
||||
'placeholder': 'شماره حساب بانکی',
|
||||
'maxlength': '20'
|
||||
'maxlength': '20',
|
||||
'required': True
|
||||
}),
|
||||
'bank_name': forms.Select(attrs={
|
||||
'class': 'form-control',
|
||||
'placeholder': 'نام بانک',
|
||||
'required': True
|
||||
}),
|
||||
}
|
||||
labels = {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ class Profile(BaseModel):
|
|||
)
|
||||
national_code = models.CharField(
|
||||
max_length=10,
|
||||
null=True,
|
||||
verbose_name="کد ملی",
|
||||
blank=True,
|
||||
validators=[
|
||||
RegexValidator(
|
||||
regex=r'^\d+$',
|
||||
|
|
@ -39,15 +37,11 @@ class Profile(BaseModel):
|
|||
]
|
||||
)
|
||||
address = models.TextField(
|
||||
null=True,
|
||||
verbose_name="آدرس",
|
||||
blank=True
|
||||
)
|
||||
card_number = models.CharField(
|
||||
max_length=16,
|
||||
null=True,
|
||||
verbose_name="شماره کارت",
|
||||
blank=True,
|
||||
validators=[
|
||||
RegexValidator(
|
||||
regex=r'^\d+$',
|
||||
|
|
@ -58,9 +52,7 @@ class Profile(BaseModel):
|
|||
)
|
||||
account_number = models.CharField(
|
||||
max_length=20,
|
||||
null=True,
|
||||
verbose_name="شماره حساب",
|
||||
blank=True,
|
||||
validators=[
|
||||
RegexValidator(
|
||||
regex=r'^\d+$',
|
||||
|
|
@ -72,9 +64,7 @@ class Profile(BaseModel):
|
|||
bank_name = models.CharField(
|
||||
max_length=255,
|
||||
choices=BANK_CHOICES,
|
||||
null=True,
|
||||
verbose_name="نام بانک",
|
||||
blank=True
|
||||
)
|
||||
phone_number_1 = models.CharField(
|
||||
max_length=11,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue