class InterestVersion(DocumentBase): modified = fields.DateTimeField() duration = fields.IntField() threshold = fields.IntField() matches = fields.ListField(fields.DocumentField(Match)) def to_dict(self): return { 'duration': self.duration, 'threshold': self.threshold, 'matches': [m.to_dict() for m in self.matches], }
class NamedRestKeyCollection(models.DataFileCollection): config_collection_name = 'adsdata_test' foo = fields.StringField(_id=True) bar = fields.IntField() baz = fields.ListField(fields.StringField()) restkey = 'baz' field_order = [foo, bar]
class CoerceCollection3(models.DataFileCollection): foo = fields.ListField(fields.IntField()) bar = fields.SetField(fields.FloatField())
class BasicCollection(models.DataFileCollection): config_collection_name = 'adsdata_test' foo = fields.StringField(_id=True) bar = fields.IntField() field_order = [foo, bar]
class CoerceCollection(models.DataFileCollection): foo = fields.StringField() bar = fields.IntField()