Ejemplo n.º 1
0
def dataset_schema(state):
    schema = mapping('dataset')
    schema.add(key('name', validator=chained(
            nonempty_string,
            reserved_name,
            database_name,
            no_double_underscore
        ),
        preparer=lambda x: x.lower().strip() if x else None))
    schema.add(key('currency', validator=chained(
            valid_currency
        )))
    schema.add(key('category', validator=chained(
            valid_category
        )))
    schema.add(key('label', validator=chained(
            nonempty_string,
        )))
    schema.add(key('description', validator=chained(
            nonempty_string,
        )))
    schema.add(sequence('languages',
        key('language', validator=valid_language), 
        missing=[]))
    schema.add(sequence('territories',
        key('territory', validator=valid_country), 
        missing=[]))
    return schema
Ejemplo n.º 2
0
def views_schema(state):
    return sequence('views', view_schema(state), missing=[])
Ejemplo n.º 3
0
def views_schema(state):
    return sequence('views', view_schema(state), missing=[])