예제 #1
0
class OptionalOuter(Model):
    nested = props.Embed(kind=OptionalNested, optional=True)
예제 #2
0
class Place(Model):
    name = props.String()
    points = props.Embed(kind=Point, optional=True, repeated=True)
예제 #3
0
class DeepA(Model):
    child = props.Embed(kind=DeepB)
예제 #4
0
class DeepC(Model):
    child = props.Embed(kind=DeepD)
예제 #5
0
def test_embed_properties_cannot_have_defaults():
    # When I try to make an Embed property with a default
    # Then I should get back a type error
    with pytest.raises(TypeError):
        props.Embed(kind=Nested, default=42)
예제 #6
0
class SplitTest(Model):
    name = props.String(indexed=True)
    slug = props.String(indexed=True)
    variations = props.Embed(kind=Variation, repeated=True)
예제 #7
0
class Outer(Model):
    x = props.Float(indexed=True)
    nested = props.Embed(name="child", kind=Nested)