示例#1
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(AUTO, None),
                               initial=OtherProperty('other_prop'))
     other_prop = validated_property('other_prop',
                                     choices=Choices(0, AUTO),
                                     initial=AUTO)
示例#2
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(
                                   'a',
                                   'b',
                                   None,
                                   integer=True,
                                   length=True,
                                   percentage=True,
                                   color=True,
                                   explicit_defaulting_constants=[
                                       INITIAL, INHERIT, UNSET, REVERT
                                   ]),
                               initial=None)
示例#3
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(
                                   'a',
                                   'b',
                                   None,
                                   validators=[
                                       is_integer, is_number, is_length,
                                       is_percentage, is_color
                                   ],
                                   explicit_defaulting_constants=[
                                       INITIAL, INHERIT, UNSET, REVERT
                                   ]),
                               initial=None)
示例#4
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(AUTO, None),
                               initial=SomeProperty())
示例#5
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(AUTO, None),
                               initial=OtherProperty('foobar'))
示例#6
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(validators=[is_length]),
                               initial=0)
示例#7
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(None),
                               initial=None)
示例#8
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices('a', 'b', None),
                               initial='a')
示例#9
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(validators=[is_uri]),
                               initial='url(google.com)')
示例#10
0
 class MyObject:
     prop = validated_property('prop',
                               choices=Choices(validators=[is_color]),
                               initial='goldenrod')
示例#11
0
 class MyObject:
     prop = validated_property(
         'prop',
         choices=Choices(validators=[is_percentage]),
         initial=99 * percent)
示例#12
0
 class MyObject:
     prop = validated_property('prop', choices=Choices(percentage=True), initial=99 * percent)
示例#13
0
 class MyObject:
     prop = validated_property('prop', choices=Choices(length=True), initial=0)
示例#14
0
 class MyObject:
     prop = validated_property('prop', choices=Choices(
         'a', 'b', None,
         integer=True, length=True, percentage=True, color=True
     ), initial=None)
示例#15
0
 class MyObject:
     prop = validated_property('prop', choices=Choices(color=True), initial='goldenrod')
示例#16
0
 class MyObject:
     prop = validated_property('prop', choices=Choices(integer=True), initial=0)