예제 #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)