Beispiel #1
0
    class B(Document):
        class Options(object):
            id = 'segment/'

        a = DocumentField(A)
        b = DocumentField('B')
        c = DocumentField('C')
Beispiel #2
0
class TypePortScan(Document):
    tcp = DictField(pattern_properties={
        PORT_PATTERN: DocumentField(PortData, as_ref=True)
    },
                    additional_properties=False)
    udp = DictField(pattern_properties={
        PORT_PATTERN: DocumentField(PortData, as_ref=True)
    },
                    additional_properties=False)
Beispiel #3
0
    class Task(Document):
        class Options(object):
            title = 'Task'
            description = 'A task.'
            definition_id = 'task'

        name = StringField(required=True, min_length=5)
        type = StringField(required=True, enum=['TYPE_1', 'TYPE_2'])
        resources = ArrayField(DocumentField(Resource))
        created_at = DateTimeField(name='created-at', required=True)
        author = DocumentField(User)
Beispiel #4
0
    class Children(Document):
        class Options(object):
            definition_id = 'children'

        children = OneOfField([
            DocumentField('A', ),
        ])
Beispiel #5
0
 class Main(Document):
     a = DocumentField('test_document.A')
     b = DocumentField('B')
Beispiel #6
0
 class Z(Document):
     main_or_x = OneOfField([DocumentField(Main), DocumentField(X)])
Beispiel #7
0
    class Test(Document):
        class Options(object):
            definition_id = 'test'

        with Scope('test') as test:
            test.field = DocumentField(RECURSIVE_REFERENCE_CONSTANT)
Beispiel #8
0
 class A(Document):
     name = StringField()
     b = DocumentField('B', as_ref=True)
Beispiel #9
0
 class B(Document):
     c = DocumentField(Main)
Beispiel #10
0
 class Main(Document):
     a = DocumentField('A')
Beispiel #11
0
 class Main(Document):
     a = DocumentField('A', as_ref=True)
Beispiel #12
0
    class A(Document):
        class Options(object):
            definition_id = 'a'

        derived_from = DocumentField(Children, as_ref=True)
Beispiel #13
0
 class A(Document):
     name = StringField()
     b = DocumentField('B')
Beispiel #14
0
 class Users(Document):
     users = ArrayField(DocumentField(User))
Beispiel #15
0
    class C(Document):
        class Options(object):
            id = 'schema_2'

        d = DocumentField('D')
        a = DocumentField(A)
Beispiel #16
0
    class B(Document):
        class Options(object):
            id = 'http://aromanovich.ru/schema_1'

        c = DocumentField('C')
Beispiel #17
0
 class Resource(Document):
     task_id = IntField(required=True)
     user = DocumentField(User, required=True)
Beispiel #18
0
    class C(Document):
        class Options(object):
            id = 'segment2/'

        a = DocumentField(A)
        d = DocumentField('D')
Beispiel #19
0
    class A(Document):
        class Options(object):
            id = 'http://example.com/schema/'

        id = StringField()
        b = DocumentField('B')
Beispiel #20
0
 class B(Document):
     c = DocumentField('C')
Beispiel #21
0
 class C(Document):
     name = StringField()
     c = DocumentField('C')
Beispiel #22
0
 class A(Document):
     name = StringField()
     a = DocumentField('A')