-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
17 lines (15 loc) · 936 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, SelectField
from wtforms.validators import InputRequired
class VirtualMachine():
def __init__(self, name, id, status):
self.name = name
self.id = id
self.status = status
class VmForm(FlaskForm):
name = StringField('name', validators=[InputRequired(), Length(message="Поле не может быть пустым")])
cpu = InputRequired('cpu', validators=[InputRequired(), Length(message="Поле не может быть пустым")])
ram = InputRequired('name', validators=[InputRequired(), Length(message="Поле не может быть пустым")])
os = SelectField(u'os', choices = ['Windows','Linux','Mac'], validators = [Required()])
sdisk = SelectField(u'sdisk', choices = ['Windows','Linux','Mac'], validators = [Required()])
odisk = StringField('name', validators=[DataRequired()])