Commit aa32c4f2 authored by Willem ter Berg's avatar Willem ter Berg

lists and ckan can go ...

parent 84fa7f26
......@@ -45,6 +45,7 @@ def create_schema(schema):
hash_validation = tk.get_validator('hash_validation')
legal_foundation_validation = tk.get_validator('legal_foundation_validation')
rights_validation = tk.get_validator('rights_validation')
to_curly_string_if_list = tk.get_converter('convert_to_curly_string_if_list')
schema.update({
# property [classification, type, content, conversion]
......@@ -105,20 +106,20 @@ def create_schema(schema):
'name': [mandatory, is_string],
'description': [mandatory, is_string],
'metadata_language': [mandatory, is_string, donl_language],
'language': [mandatory, is_list, donl_language],
'language': [mandatory, is_list, donl_language, to_curly_string_if_list],
'license': [mandatory, overheid_license],
'format': [mandatory, is_string, mdr_filetype_nal],
'size': [recommended, is_number],
'download_url': [recommended, is_string, is_uri],
'download_url': [recommended, is_list, is_uri, to_curly_string_if_list],
'mimetype': [recommended, is_string, iana_mediatypes],
'release_date': [recommended, is_string, is_date],
'rights': [recommended, is_string],
'status': [recommended, is_string, adms_distributiestatus],
'modification_date': [recommended, is_string, is_date],
'linked_schemas': [recommended, is_list, is_uri],
'linked_schemas': [recommended, is_list, is_uri, to_curly_string_if_list],
'hash': [optional, is_string],
'hash_algorithm': [optional, is_string],
'documentation': [optional, is_list, is_uri],
'documentation': [optional, is_list, is_uri, to_curly_string_if_list],
'__after': [hash_validation]
})
......@@ -164,6 +165,7 @@ def update_schema(schema):
legal_foundation_validation = tk.get_validator('legal_foundation_validation')
rights_validation = tk.get_validator('rights_validation')
to_list_if_curly_string = tk.get_converter('convert_to_list_if_curly_string')
to_curly_string_if_list = tk.get_converter('convert_to_curly_string_if_list')
schema.update({
# property [classification, type, content, conversion]
......@@ -224,20 +226,20 @@ def update_schema(schema):
'name': [mandatory, is_string],
'description': [mandatory, is_string],
'metadata_language': [mandatory, is_string, donl_language],
'language': [mandatory, to_list_if_curly_string, is_list, donl_language],
'language': [mandatory, to_list_if_curly_string, is_list, donl_language, to_curly_string_if_list],
'license': [mandatory, overheid_license],
'format': [mandatory, is_string, mdr_filetype_nal],
'size': [recommended, is_number],
'download_url': [recommended, is_string, is_uri],
'download_url': [recommended, to_list_if_curly_string, is_list, is_uri, to_curly_string_if_list],
'mimetype': [recommended, is_string, iana_mediatypes],
'release_date': [recommended, is_string, is_date],
'rights': [recommended, is_string],
'status': [recommended, is_string, adms_distributiestatus],
'modification_date': [recommended, is_string, is_date],
'linked_schemas': [recommended, to_list_if_curly_string, is_list, is_uri],
'linked_schemas': [recommended, to_list_if_curly_string, is_list, is_uri, to_curly_string_if_list],
'hash': [optional, is_string],
'hash_algorithm': [optional, is_string],
'documentation': [optional, to_list_if_curly_string, is_list, is_uri],
'documentation': [optional, to_list_if_curly_string, is_list, is_uri, to_curly_string_if_list],
'__after': [hash_validation]
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment