Example #1
0
def compound_dimension_schema(name, state):
    schema = property_schema(name, state)
    schema.add(sequence('fields', dimension_attribute_schema(state),
        validator=chained(
            compound_attributes_include_name,
            compound_attributes_include_label
        )))
    return schema
Example #2
0
def dataset_schema(state):
    schema = mapping('dataset')
    schema.add(key('name', validator=chained(
            nonempty_string,
            reserved_name,
            database_name,
            no_double_underscore
        )))
    schema.add(key('currency', validator=chained(
            valid_currency
        )))
    schema.add(key('label', validator=chained(
            nonempty_string,
        )))
    schema.add(key('description', validator=chained(
            nonempty_string,
        )))
    schema.add(sequence('unique_keys',
        key('key', validator=chained(
            unique_keys_are_attributes(state),
        )), missing=[]))
    return schema
Example #3
0
def views_schema(state):
    return sequence('views', view_schema(state), missing=[])