class Meta: """ Meta-info for the form.""" model = Appearance exclude = ['own_goals'] widgets = { 'green_card': widgets.NullBooleanSelect(attrs={'class': 'input-small'}), 'yellow_card': widgets.NullBooleanSelect(attrs={'class': 'input-small'}), 'red_card': widgets.NullBooleanSelect(attrs={'class': 'input-small'}), }
class Meta: model = models.DomainTop fields = "__all__" widgets = { 'domain_name': form_widgets.TextInput(attrs={'class': 'form-control'}), 'creation_date': form_widgets.DateTimeInput(attrs={'class': 'form-control'}), 'expiration_date': form_widgets.DateTimeInput(attrs={'class': 'form-control'}), 'icp_num': form_widgets.TextInput(attrs={'class': 'form-control'}), 'gongan_num': form_widgets.TextInput(attrs={'class': 'form-control'}), 'ssl_creation_date': form_widgets.DateInput(attrs={'class': 'form-control'}), 'ssl_expiration_date': form_widgets.DateInput(attrs={'class': 'form-control'}), 'ssl_brand': form_widgets.TextInput(attrs={'class': 'form-control'}), 'ssl_proxy': form_widgets.TextInput(attrs={'class': 'form-control'}), 'is_public': form_widgets.NullBooleanSelect(attrs={'class': 'form-control'}), } error_messages = { 'domain_name': { 'required': '*名称不能为空' }, }
class BinaryReportForm(BaseTrialReportForm): """ Report on a binary outcome """ class Meta: binary = True model = Report binary = fields.NullBooleanField(widget=widgets.NullBooleanSelect( attrs={'data-required': 'true'}))
class Meta: model = models.Internet_Info fields = [ 'middleware', 'middleware_version', 'is_out', 'out_key', 'web_status', 'language', 'language_version', 'web_framwork', 'web_framwork_version' ] widgets = { 'middleware': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '中间件' }), 'middleware_version': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '中间件版本' }), 'is_out': widgets.NullBooleanSelect(attrs={ 'class': 'form-control', 'placeholder': '是否发布' }), 'out_key': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '外网域名' }), 'web_status': widgets.Select(attrs={ 'class': 'form-control', 'placeholder': '状态说明' }), 'language': widgets.Select(attrs={ 'class': 'form-control', 'placeholder': '开发语言' }), 'language_version': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '语言版本' }), 'web_framwork': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '开发框架' }), 'web_framwork_version': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '框架版本' }), }
class Meta: model=models.UserInfo fields='__all__' from django.forms import widgets as wid widgets={ 'name':wid.TextInput(attrs={'class':'form-control'}), 'pwd':wid.PasswordInput(attrs={'class':'form-control'}), 'is_book':wid.NullBooleanSelect(attrs={'class':'form-control'}) } labels={ 'name':'用户名', 'pwd':'密码', 'is_book':'预订权限' }
class Meta: model = User exclude = ['id', 'last_login', 'is_superuser', 'is_active', 'date_joined', 'groups', 'user_permissions', 'address'] widgets = { 'username': widgets.TextInput(attrs={'class': 'form-control'}), 'password': widgets.PasswordInput(attrs={'class': 'form-control'}), 'email': widgets.EmailInput(attrs={'class': 'form-control'}), 'first_name': widgets.TextInput(attrs={'class': 'form-control'}), 'last_name': widgets.TextInput(attrs={'class': 'form-control'}), 'image': widgets.URLInput(attrs={'class': 'form-control'}), 'enabled': widgets.NullBooleanSelect(attrs={'class': 'form-control'}), # Add option to create staff or superuser? }
class Meta: model = Product exclude = ['id', 'tag'] widgets = { 'name': widgets.TextInput(attrs={'class': 'form-control'}), 'price': widgets.NumberInput(attrs={'class': 'form-control'}), 'enabled': widgets.NullBooleanSelect(attrs={ 'class': 'form-control' }).is_required, 'discount': widgets.NumberInput(attrs={'class': 'form-control'}), 'short_description': widgets.TextInput(attrs={'class': 'form-control'}), 'long_description': widgets.Textarea(attrs={'class': 'form-control'}), 'category': widgets.Select(attrs={'class': 'form-control'}), }
class Meta: model = models.Mapped fields = [ 'mapped_status', 'Domain', 'start_time', 'end_time', 'request_email', 'action_email', 'request_order', 'request_user', 'request_user_num', 'request_user_department', 'telephone', 'Mapped_description' ] widgets = { 'Domain': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '域名' }), 'start_time': widgets.DateInput( attrs={ 'class': 'layui-input date', 'placeholder': 'yyyy-MM-dd', 'autocomplete': 'off', 'lay-verify': 'date' }), 'end_time': widgets.DateInput( attrs={ 'class': 'layui-input date', 'placeholder': 'yyyy-MM-dd', 'autocomplete': 'off', 'lay-verify': 'date' }), 'mapped_status': widgets.NullBooleanSelect(attrs={ 'class': 'form-control', 'placeholder': '是否使用' }), 'request_email': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '申请人邮箱' }), 'action_email': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '操作人邮箱' }), 'request_order': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '申请单号,可为空' }), 'request_user': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '申请人员,可为空' }), 'request_user_num': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '员工编号,可为空' }), 'request_user_department': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '申请人部门,可为空' }), 'telephone': widgets.TextInput(attrs={ 'class': 'form-control', 'placeholder': '申请人电话,可为空' }), 'Mapped_description': widgets.Textarea(attrs={ 'class': 'form-control', 'placeholder': '备注信息,可为空' }), }