From 4c5cacd916f91a3b90253af01e340eb2a73c5b03 Mon Sep 17 00:00:00 2001 From: wcharles Date: Thu, 24 Oct 2019 15:23:20 +0800 Subject: [PATCH] add form --- groups/forms.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/groups/forms.py b/groups/forms.py index 116bc045..cd6aabf3 100644 --- a/groups/forms.py +++ b/groups/forms.py @@ -1,7 +1,26 @@ 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())#所属公司