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,
    )
Exemple #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)
 class Thing(JsonRecord):
     flintstone = JsonProperty()
     element = JsonProperty()
class MockDelegateJsonRecord(JsonRecord):
    other = JsonProperty()
class MockChildRecord(JsonRecord):
    name = JsonProperty()