Moved Attract node types from Pillar to bcloud.attract module.
Also added a tuple bcloud.attract.node_types.NODE_TYPES that contains all Attract node types, for easy reference.
This commit is contained in:
@@ -65,10 +65,7 @@ def setup_for_attract(project_url, replace=False):
|
|||||||
(by default already existing Attract node types are skipped).
|
(by default already existing Attract node types are skipped).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# TODO: move those node types into this extension.
|
from .node_types import NODE_TYPES
|
||||||
from pillar.api.node_types.act import node_type_act
|
|
||||||
from pillar.api.node_types.scene import node_type_scene
|
|
||||||
from pillar.api.node_types.shot import node_type_shot
|
|
||||||
|
|
||||||
# Copy permissions from the project, then give everyone with PUT
|
# Copy permissions from the project, then give everyone with PUT
|
||||||
# access also DELETE access.
|
# access also DELETE access.
|
||||||
@@ -85,12 +82,10 @@ def setup_for_attract(project_url, replace=False):
|
|||||||
|
|
||||||
# Make a copy of the node types when setting the permissions, as
|
# Make a copy of the node types when setting the permissions, as
|
||||||
# we don't want to mutate the global node type objects.
|
# we don't want to mutate the global node type objects.
|
||||||
node_type_act = dict(permissions=permissions, **node_type_act)
|
node_types = (dict(permissions=permissions, **nt) for nt in NODE_TYPES)
|
||||||
node_type_scene = dict(permissions=permissions, **node_type_scene)
|
|
||||||
node_type_shot = dict(permissions=permissions, **node_type_shot)
|
|
||||||
|
|
||||||
# Add the missing node types.
|
# Add the missing node types.
|
||||||
for node_type in (node_type_act, node_type_scene, node_type_shot):
|
for node_type in node_types:
|
||||||
found = [nt for nt in project['node_types']
|
found = [nt for nt in project['node_types']
|
||||||
if nt['name'] == node_type['name']]
|
if nt['name'] == node_type['name']]
|
||||||
if found:
|
if found:
|
||||||
|
7
bcloud/attract/node_types/__init__.py
Normal file
7
bcloud/attract/node_types/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
from .act import node_type_act
|
||||||
|
from .scene import node_type_scene
|
||||||
|
from .shot import node_type_shot
|
||||||
|
from .task import node_type_task
|
||||||
|
|
||||||
|
NODE_TYPES = (node_type_act, node_type_scene, node_type_shot, node_type_task)
|
||||||
|
|
5
bcloud/attract/node_types/act.py
Normal file
5
bcloud/attract/node_types/act.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_type_act = {
|
||||||
|
'name': 'act',
|
||||||
|
'description': 'Act node type',
|
||||||
|
'parent': []
|
||||||
|
}
|
5
bcloud/attract/node_types/scene.py
Normal file
5
bcloud/attract/node_types/scene.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
node_type_scene = {
|
||||||
|
'name': 'scene',
|
||||||
|
'description': 'Scene node type',
|
||||||
|
'parent': ['act'],
|
||||||
|
}
|
45
bcloud/attract/node_types/shot.py
Normal file
45
bcloud/attract/node_types/shot.py
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
node_type_shot = {
|
||||||
|
'name': 'shot',
|
||||||
|
'description': 'Shot Node Type, for shots',
|
||||||
|
'dyn_schema': {
|
||||||
|
'url': {
|
||||||
|
'type': 'string',
|
||||||
|
},
|
||||||
|
'cut_in': {
|
||||||
|
'type': 'integer'
|
||||||
|
},
|
||||||
|
'cut_out': {
|
||||||
|
'type': 'integer'
|
||||||
|
},
|
||||||
|
'status': {
|
||||||
|
'type': 'string',
|
||||||
|
'allowed': [
|
||||||
|
'on_hold',
|
||||||
|
'todo',
|
||||||
|
'in_progress',
|
||||||
|
'review',
|
||||||
|
'final'
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'notes': {
|
||||||
|
'type': 'string',
|
||||||
|
'maxlength': 256,
|
||||||
|
},
|
||||||
|
'shot_group': {
|
||||||
|
'type': 'string',
|
||||||
|
#'data_relation': {
|
||||||
|
# 'resource': 'nodes',
|
||||||
|
# 'field': '_id',
|
||||||
|
#},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
'form_schema': {
|
||||||
|
'url': {},
|
||||||
|
'cut_in': {},
|
||||||
|
'cut_out': {},
|
||||||
|
'status': {},
|
||||||
|
'notes': {},
|
||||||
|
'shot_group': {}
|
||||||
|
},
|
||||||
|
'parent': ['scene']
|
||||||
|
}
|
107
bcloud/attract/node_types/task.py
Normal file
107
bcloud/attract/node_types/task.py
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
node_type_task = {
|
||||||
|
'name': 'task',
|
||||||
|
'description': 'Task Node Type, for tasks',
|
||||||
|
'dyn_schema': {
|
||||||
|
'status': {
|
||||||
|
'type': 'string',
|
||||||
|
'allowed': [
|
||||||
|
'todo',
|
||||||
|
'in_progress',
|
||||||
|
'on_hold',
|
||||||
|
'approved',
|
||||||
|
'cbb',
|
||||||
|
'final',
|
||||||
|
'review'
|
||||||
|
],
|
||||||
|
'required': True,
|
||||||
|
},
|
||||||
|
'filepath': {
|
||||||
|
'type': 'string',
|
||||||
|
},
|
||||||
|
'revision': {
|
||||||
|
'type': 'integer',
|
||||||
|
},
|
||||||
|
'owners': {
|
||||||
|
'type': 'dict',
|
||||||
|
'schema': {
|
||||||
|
'users': {
|
||||||
|
'type': 'list',
|
||||||
|
'schema': {
|
||||||
|
'type': 'objectid',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'groups': {
|
||||||
|
'type': 'list',
|
||||||
|
'schema': {
|
||||||
|
'type': 'objectid',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'time': {
|
||||||
|
'type': 'dict',
|
||||||
|
'schema': {
|
||||||
|
'start': {
|
||||||
|
'type': 'datetime'
|
||||||
|
},
|
||||||
|
'duration': {
|
||||||
|
'type': 'integer'
|
||||||
|
},
|
||||||
|
'chunks': {
|
||||||
|
'type': 'list',
|
||||||
|
'schema': {
|
||||||
|
'type': 'dict',
|
||||||
|
'schema': {
|
||||||
|
'start': {
|
||||||
|
'type': 'datetime',
|
||||||
|
},
|
||||||
|
'duration': {
|
||||||
|
'type': 'integer',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'is_conflicting' : {
|
||||||
|
'type': 'boolean'
|
||||||
|
},
|
||||||
|
'is_processing' : {
|
||||||
|
'type': 'boolean'
|
||||||
|
},
|
||||||
|
'is_open' : {
|
||||||
|
'type': 'boolean'
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
'form_schema': {
|
||||||
|
'status': {},
|
||||||
|
'filepath': {},
|
||||||
|
'revision': {},
|
||||||
|
'owners': {
|
||||||
|
'schema': {
|
||||||
|
'users':{
|
||||||
|
'items': [('User', 'first_name')],
|
||||||
|
},
|
||||||
|
'groups': {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'time': {
|
||||||
|
'schema': {
|
||||||
|
'start': {},
|
||||||
|
'duration': {},
|
||||||
|
'chunks': {
|
||||||
|
'visible': False,
|
||||||
|
'schema': {
|
||||||
|
'start': {},
|
||||||
|
'duration': {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'is_conflicting': {},
|
||||||
|
'is_open': {},
|
||||||
|
'is_processing': {},
|
||||||
|
},
|
||||||
|
'parent': ['shot']
|
||||||
|
}
|
Reference in New Issue
Block a user