Completed
Push — master ( a1e8f3...b95acc )
by Oleksandr
02:23
created

DeviceLink

Complexity

Total Complexity 0

Size/Duplication

Total Lines 4
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 0
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
1
# coding: utf-8
2
3 1
from schematics.models import Model
4 1
from schematics.types import StringType, IntType
5 1
from schematics.types.compound import ListType, ModelType
6
7
8 1
class Connection(Model):
9 1
    host = StringType(
10
        default="",
11
        required=True,
12
    )
13 1
    port = IntType(
14
        min_value=0,
15
        max_value=65000,
16
        default=0,
17
        required=True,
18
    )
19 1
    allowed_hosts = ListType(
20
        field=StringType,
21
        min_size=0,
22
        required=True,
23
        min_length=1,
24
    )
25
26
27 1
class DeviceLink(Model):
28 1
    connection = ModelType(
29
        model_spec=Connection,
30
        required=True,
31
    )
32