Exemple #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)
Exemple #2
0
        class Foo(object):
            ''' Foo '''

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