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],
        }
示例#2
0
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]
示例#3
0
 class CoerceCollection3(models.DataFileCollection):
     foo = fields.ListField(fields.IntField())
     bar = fields.SetField(fields.FloatField())
示例#4
0
class BasicCollection(models.DataFileCollection):
    config_collection_name = 'adsdata_test'
    foo = fields.StringField(_id=True)
    bar = fields.IntField()
    field_order = [foo, bar]
示例#5
0
 class CoerceCollection(models.DataFileCollection):
     foo = fields.StringField()
     bar = fields.IntField()