1234567891011121314151617181920212223242526272829 |
- from django import forms
- from SharixAdmin.models import SharixUser
- from webservice_running.models import OrdersLocal
- from django.contrib.auth.forms import UserCreationForm
- class OrderRegForm(forms.ModelForm):
- class Meta:
- model = OrdersLocal
- fields = '__all__'
- def __init__(self, *args, **kwargs):
- super().__init__(*args, **kwargs)
- for field in self.fields.values():
- field.widget.attrs['class'] = 'form-control'
- class RegisterUserForm(UserCreationForm):
- password1 = forms.CharField(label="Пароль",
- widget=forms.PasswordInput(attrs={'class':'form-control'}))
-
- password2 = forms.CharField(label="Подтверждение пароля",
- widget=forms.PasswordInput(attrs={'class':'form-control'}))
- username = forms.CharField(label="Номер телефона",
- widget=forms.TextInput(attrs={'class':'form-control'}))
- class Meta:
- model = SharixUser
- fields = ['username', 'password1', 'password2']
|