예제 #1
0
class ValidStationSchema(ValidBboxSchema, ValidPositionSchema,
                         ValidTimeTrackingSchema):
    """A schema which validates the fields in a station."""

    radius = colander.SchemaNode(colander.Integer(), missing=0)
    region = colander.SchemaNode(colander.String(), missing=None)
    samples = colander.SchemaNode(colander.Integer(), missing=0)
    source = StationSourceNode(StationSourceType(), missing=None)

    block_first = colander.SchemaNode(DateFromString(), missing=None)
    block_last = colander.SchemaNode(DateFromString(), missing=None)
    block_count = colander.SchemaNode(colander.Integer(), missing=0)
class ValidCellAreaSchema(ValidCellAreaKeySchema, ValidPositionSchema,
                          ValidTimeTrackingSchema):

    # areaid is a derived value
    radius = colander.SchemaNode(colander.Integer(),
                                 missing=None,
                                 validator=colander.Range(
                                     0, constants.CELLAREA_MAX_RADIUS))
    region = colander.SchemaNode(colander.String(), missing=None)
    avg_cell_radius = colander.SchemaNode(colander.Integer(), missing=None)
    num_cells = colander.SchemaNode(colander.Integer(), missing=None)
    last_seen = colander.SchemaNode(DateFromString(), missing=None)