class Meta: model = DatosExperienciaLaboralD10 fields = '__all__' widgets = { 'fecha_inicio': forms.DateInput(attrs={'class': 'form-control datepicker', 'autocomplete': 'off'}), 'fecha_finalizacion': forms.DateInput(attrs={'class': 'form-control datepicker', 'autocomplete': 'off'}), 'funciones_realizadas': forms.Textarea(), 'logros': forms.Textarea(), }
class Meta: model = DatosBasicosD10 fields = '__all__' widgets = { 'perfil_ocupacional': forms.Textarea(attrs={'rows': '10'}), 'sistemas_que_maneja': forms.Textarea(attrs={'rows': '10'}), 'semestre': forms.DateTimeInput(attrs={'class': 'form-control required'}), 'foto': forms.FileInput() }
class EditProfile(UserChangeForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields['bio'].required = False self.fields['name'].required = False name = forms.CharField(label='تغییر نام', widget=forms.TextInput(attrs={ 'class': 'form-control', 'dir': 'rtl', })) email = forms.EmailField(label='تغییر ایمیل', widget=forms.EmailInput(attrs={ 'class': 'form-control', })) bio = forms.CharField( label='تغییر بیو', widget=forms.Textarea(attrs={ 'rows': 1, 'cols': 15, 'class': 'form-control', 'dir': 'rtl', })) avatar = forms.ImageField(label='تغییر عکس') class Meta: model = get_user_model() fields = ('email', 'name', 'bio', 'avatar', 'password')
class UserUpdateForm(forms.ModelForm): bio = forms.Textarea() class Meta: model = models.User fields = ('avatar', 'username', 'email', 'bio', 'male', 'first_name', 'last_name')
class EditProfile(UserChangeForm): name = forms.CharField(label='تغییر نام', widget=forms.TextInput(attrs={ 'class': 'form-control', 'dir': 'rtl', })) email = forms.EmailField(label='تغییر ایمیل', widget=forms.EmailInput(attrs={ 'class': 'form-control', })) bio = forms.CharField(label='تغییر بیو', widget=forms.Textarea( attrs={ 'rows': 1, 'cols': 15, 'autofocus': 'autofocus', 'class': 'form-control', 'dir': 'rtl', })) avatar = forms.ImageField(label='تغییر عکس') class Meta: model = User fields = ('email', 'name', 'bio', 'avatar', 'password')
class AnswerCreateForm(forms.ModelForm): text = forms.CharField(label='پاسخ شما', widget=forms.Textarea(attrs={ 'class': 'form-control', 'dir': 'rtl', })) class Meta: model = Answer fields = ('text', )
class newPostForm(forms.Form): title = forms.CharField(max_length=150, label='Title') post = forms.CharField(widget=forms.Textarea(attrs={ "rows": 5, "cols": 20 }), label='Post') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout('title', 'post', Submit('submit', 'Upload Post'))
class CreateApplyForm(forms.ModelForm): use = forms.ChoiceField(label=ugettext('贷款用途及贷款用途子类'), choices=LOAN_USES, widget=forms.Select(attrs={ 'class': 'form-control', })) description = forms.CharField(label=ugettext(''), widget=forms.Textarea(attrs={ 'class': 'form-control', 'rows': 5, })) amount = forms.ChoiceField(label=ugettext('申请金额'), choices=LOAN_AMOUNTS, widget=forms.Select(attrs={ 'class': 'form-control', })) education = forms.ChoiceField(label=ugettext('教育程度'), choices=EDUCATION_LEVEL, widget=forms.RadioSelect()) marriage = forms.ChoiceField(label=ugettext('婚姻状况'), choices=MARRIAGE_STATE, widget=forms.RadioSelect()) members = forms.ChoiceField(label=ugettext('家庭人口'), choices=MEMBER_OF_FAMILY, widget=forms.RadioSelect()) incoming = forms.ChoiceField(label=ugettext('收入水平(全年收入月平均)'), choices=INCOMING_LEVEL, widget=forms.RadioSelect()) property = forms.ChoiceField(label=ugettext('居住类型'), choices=PROPERTIES, widget=forms.RadioSelect()) vehicle = forms.ChoiceField(label=ugettext('主要出行交通工具'), choices=VEHICLES, widget=forms.RadioSelect()) residence = forms.CharField(label=ugettext('住宅地址'), widget=forms.HiddenInput()) employment = forms.ChoiceField(label=ugettext('受雇类型'), choices=EMPLOYMENTS, widget=forms.RadioSelect()) company = forms.CharField( label=ugettext('公司名称'), required=False, widget=forms.TextInput(attrs={ 'class': 'form-control', 'style': 'display:none', })) class Meta: model = Loan fields = []
class QuestionCreateForm(forms.ModelForm): title = forms.CharField(label='عنوان پرسش', widget=forms.TextInput(attrs={ 'class': 'form-control', 'dir': 'rtl', })) text = forms.CharField(label='متن پرسش', widget=forms.Textarea(attrs={ 'class': 'form-control', 'dir': 'rtl', })) class Meta: model = Question fields = ('title', 'text', 'tags')
class ReplyCreateForm(forms.ModelForm): text = forms.CharField( label='', widget=forms.Textarea( attrs={ 'class': 'form-control', 'dir': 'rtl', 'rows': 5, 'style': 'resize: none;' } ) ) class Meta: model = Reply fields = ('text',)
class Meta: model = note fields = ['title', 'content'] widgets = { 'title': forms.TextInput(attrs={ 'class': 'btn btn-outline-warning my-2 my-sm-0', 'name': 'title' }), 'content': forms.Textarea( attrs={ 'class': 'edittext btn-outline-warning my-2 my-sm-0', 'rows': '15', 'name': 'content', 'style': "width: 100%; max-width: 100%; min-width: 100% 354152; height: 600px; resize: vertical;" }) }
class PersonalDataForm(forms.Form): first_name = forms.CharField(required=True, max_length=255) last_name = forms.CharField(required=True, max_length=255) email = forms.EmailField(required=True) phone = forms.CharField(required=True, max_length=200) address = forms.CharField(max_length=1000, widget=forms.Textarea())
class Meta: model = Song fields = ['title', 'lyrics'] labels = {'title': '', 'lyrics': ''} widgets = {'lyrics': forms.Textarea(attrs={'cols': 80})}