Пример #1
0
 class Dummy(mapping.Mapping):
     foo = mapping.Field(default='bar')
     bar = mapping.ComponentField(mapping=mapping.Component.build(
         mapping.IntegerField(name='a'),
         mapping.IntegerField(name='b'),
         mapping.IntegerField(name='c'),
     ),
                                  default=[1, 2, 3])
Пример #2
0
 class Thing(mapping.Mapping):
     numbers = mapping.RepeatedComponentField(
         mapping.Component.build(mapping.IntegerField(name='a'),
                                 mapping.IntegerField(name='b')))
Пример #3
0
 class Dummy(mapping.Mapping):
     field = mapping.IntegerField()
Пример #4
0
 class Dummy(mapping.Mapping):
     field = mapping.RepeatedComponentField(
         mapping.Component.build(
             mapping.TextField(name='key'),
             mapping.IntegerField(name='value'),
         ))
Пример #5
0
 class Dummy(mapping.Mapping):
     field = mapping.ComponentField(mapping=mapping.Component.build(
         mapping.Field(name='foo'), mapping.IntegerField(name='bar'),
         mapping.ConstantField(name='baz', default='42')))
Пример #6
0
 class Dummy(mapping.Mapping):
     field = mapping.SetField(values=[1, 2, 3],
                              field=mapping.IntegerField())