safesite/groups/forms.py

27 lines
1.6 KiB
Python

from django import forms
from captcha.fields import CaptchaField
from safesite import models as s_models
class GroupUserForm(forms.Form):
username = forms.CharField(label="用户名", max_length=128, widget=forms.TextInput(attrs={'class': 'form-control', 'placeholder': "账户",'autofocus': ''}))
password = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput(attrs={'class': 'form-control','placeholder': "密码"}))
captcha = CaptchaField(label='验证码', error_messages={"invalid":"验证码错误"})
class UserForm(forms.Form):
mark = (
('1', "未删除"),
('0', "删除"),
)
username = forms.CharField(label="账号",max_length=30, widget=forms.TextInput())
name = forms.CharField(label="姓名", max_length=20, widget=forms.TextInput())
empid = forms.CharField(label="工号", max_length=20, widget=forms.TextInput())
password = forms.CharField(label="密码", max_length=256, widget=forms.PasswordInput())
ubelongpart = forms.ModelChoiceField(queryset=s_models.Partment.objects.all())
openid = forms.CharField(label="公众号openid", max_length=200, widget=forms.TextInput())
nickname = forms.CharField(label="昵称", max_length=200, widget=forms.TextInput())
mpopenid = forms.CharField(label="小程序openid", max_length=200, widget=forms.TextInput())
deletemark = forms.ChoiceField(label='删除标记', choices=mark)
headimgurl = forms.CharField(label="头像", max_length=200, required=False, widget=forms.TextInput())
usecomp = forms.ModelChoiceField(queryset=s_models.Partment.objects.all())#所属公司