v0.1 基础版本

v0.1 基础版本
This commit is contained in:
何全
2019-03-02 12:02:55 +08:00
parent 16f25e8147
commit a059c74cb4
2331 changed files with 524759 additions and 2 deletions

27
assets/form.py Normal file
View 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