Пример #1
0
 class WrongType(BASE):
     prop = declarative.PropertyDefinition(
         allowed_values=['foo', 'bar'], default='baz')
Пример #2
0
 class TestType(BASE):
     simple_prop = declarative.PropertyDefinition()
     immutable_internal = declarative.PropertyDefinition(mutable=False,
                                                         internal=True)
     prop_with_allowed = declarative.PropertyDefinition(
         allowed_values=["Foo", True, 42])
Пример #3
0
 class DerivedType(TestType):
     prop_with_allowed = declarative.PropertyDefinition(
         allowed_values=["Foo", True, 42], required=True, default=42)
Пример #4
0
 class TestType(BASE):
     defaulted = declarative.PropertyDefinition(default=42)
     read_only = declarative.PropertyDefinition(readonly=True)
     required_attr = declarative.PropertyDefinition(required=True)