Пример #1
0
class MockExtraneousJsonRecord(JsonRecord):
    count = JsonProperty(isa=int)
    last_updated = JsonProperty(
        isa=datetime,
        coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
        extraneous=False,
    )
Пример #2
0
class MockJsonRecord(JsonRecord):
    name = JsonProperty()
    age = JsonProperty(isa=int)
    seen = JsonProperty(
        json_name='last_seen', isa=datetime,
        coerce=lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%S'),
    )
    children = JsonCollectionProperty(of=MockChildRecord)
Пример #3
0
 class Thing(JsonRecord):
     flintstone = JsonProperty()
     element = JsonProperty()
Пример #4
0
class MockDelegateJsonRecord(JsonRecord):
    other = JsonProperty()
Пример #5
0
class MockChildRecord(JsonRecord):
    name = JsonProperty()