mirror of
https://github.com/hequan2017/seal.git
synced 2026-05-12 11:35:58 +08:00
v0.1 基础版本
v0.1 基础版本
This commit is contained in:
27
assets/form.py
Normal file
27
assets/form.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from django import forms
|
||||
from assets.models import Ecs
|
||||
|
||||
|
||||
class EcsForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Ecs
|
||||
fields = '__all__'
|
||||
|
||||
widgets = {
|
||||
'type': forms.Select(
|
||||
attrs={'class': 'select2',
|
||||
'data-placeholder': '----请选择环境----'}),
|
||||
}
|
||||
|
||||
help_texts = {
|
||||
'type': '* 请选择 资产所在平台.',
|
||||
|
||||
}
|
||||
|
||||
def clean_type(self):
|
||||
"""
|
||||
自定义验证
|
||||
:return:
|
||||
"""
|
||||
type = self.cleaned_data['type']
|
||||
return type
|
||||
Reference in New Issue
Block a user