From 589d91675903ac87c5c5e963c684986e760709f7 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Tue, 19 Jul 2016 18:10:59 +0200 Subject: [PATCH] Introducing HDRI node_type --- pillar/manage_extra/node_types/hdri.py | 68 ++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 pillar/manage_extra/node_types/hdri.py diff --git a/pillar/manage_extra/node_types/hdri.py b/pillar/manage_extra/node_types/hdri.py new file mode 100644 index 00000000..1efa949f --- /dev/null +++ b/pillar/manage_extra/node_types/hdri.py @@ -0,0 +1,68 @@ +from manage_extra.node_types import _file_embedded_schema + +node_type_hdri = { + # When adding this node type, make sure to enable CORS from * on the GCS + # bucket (https://cloud.google.com/storage/docs/cross-origin) + 'name': 'hdri', + 'description': 'HDR Image', + # This data type does not have parent limitations (can be child + # of any node). An empty parent declaration is required. + 'parent': ['group', ], + 'dyn_schema': { + 'status': { + 'type': 'string', + 'allowed': [ + 'published', + 'pending', + ], + }, + # Used for sorting within the context of a group + 'order': {'type': 'integer'}, + # We point to the file resloutions (and use it to extract any relevant + # variation useful for our scope). + 'files': { + 'type': 'list', + 'schema': { + 'type': 'dict', + 'schema': { + 'file': _file_embedded_schema, + 'resolution': { + 'type': 'string', + 'required': True} + } + } + }, + # Tags for search + 'tags': { + 'type': 'list', + 'schema': { + 'type': 'string' + } + }, + # Simple string to represent hierarchical categories. Should follow + # this schema: "Root > Nested Category > One More Nested Category" + 'categories': { + 'type': 'string' + }, + 'license_type': { + 'default': 'cc-by', + 'type': 'string', + 'allowed': [ + 'cc-by', + 'cc-0', + 'cc-by-sa', + 'cc-by-nd', + 'cc-by-nc', + 'copyright' + ] + }, + 'license_notes': { + 'type': 'string' + }, + }, + 'form_schema': { + 'content_type': {'visible': False}, + 'tags': {'visible': False}, + 'categories': {'visible': False}, + } +}