for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# coding: utf-8
from schematics.models import Model
from schematics.types import StringType, IntType
from schematics.types.compound import ListType, ModelType
class Connection(Model):
host = StringType(
default="",
required=True,
)
port = IntType(
min_value=0,
max_value=65000,
default=0,
allowed_hosts = ListType(
field=StringType,
min_size=0,
min_length=1,
class DeviceLink(Model):
connection = ModelType(
model_spec=Connection,