示例#1
0
    def test_proxy_autotype(self):
        from jsonable_objects.proxy import proxy
        from jsonable_objects.proxy import Field

        @proxy(dict)
        class Foo(object):
            id = Field(type=int)

        foo = Field(proxy=Foo)
        self.assertTrue(foo.type is dict)
示例#2
0
        class Foo(object):
            ''' Foo '''

            id = Field()
示例#3
0
 class Foo(object):
     bar = Field(type=dict, proxy=Bar)
示例#4
0
 class Seq(object):
     foo = Field()
示例#5
0
 class Content(Node, User):
     content = Field(type=str)
示例#6
0
 class Node(object):
     id = Field(type=int)
示例#7
0
 class Qux(object):
     foo = Field(proxy=Foo)
     bar = Field(proxy=Bar)
示例#8
0
 class Foo(object):
     bar = Field(type=dict, optional=True, proxy=Bar, format=barFormat)
示例#9
0
 class Foo(object):
     bar = Field(type=dict)
示例#10
0
 class Foo(object):
     bar = Field(type=str)
示例#11
0
 class Foo(object):
     bar = Field(type=float)
示例#12
0
 class Foo(object):
     bar = Field(type=int, optional=True)
示例#13
0
 class Foo(object):
     bar = Field(type=int)
示例#14
0
 class Foo(object):
     bar = Field(optional=True)
示例#15
0
 class Foo(object):
     bar = Field()
示例#16
0
 class Foo(object):
     bar = Field(type=dict, optional=True, proxy=Bar)
示例#17
0
 class Bar(object):
     id = Field(type=int)
示例#18
0
 class Foo(object):
     bar = Field(predicate=lambda value: value >= 0)
示例#19
0
 class Bar(object):
     foo = Field(key='foo-in-bar', proxy=Foo)
示例#20
0
 class Foo(object):
     bar = Field(type=int, predicate=lambda value: value >= 0)
示例#21
0
 class Foo(object):
     id = Field(type=int)
示例#22
0
 class Foo(object):
     uuid = Field(type=str, format=uuidFormat)
示例#23
0
 class User(Node):
     name = Field(type=str)
示例#24
0
 class Foo(object):
     uuid = Field(type=str, optional=True, format=uuidFormat)
示例#25
0
 class Foo(object):
     id = Field()
示例#26
0
 class Foo(object):
     bar = Field(type=list)