From 3f81873c7f41dd7ecdcf169a28ee5eaa9be85a43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 7 Sep 2016 10:02:10 +0200 Subject: [PATCH] Refactor of 'task' node type --- attract_server/node_types/task.py | 86 +++++++++---------------------- 1 file changed, 24 insertions(+), 62 deletions(-) diff --git a/attract_server/node_types/task.py b/attract_server/node_types/task.py index 7de52aa..317b3c8 100644 --- a/attract_server/node_types/task.py +++ b/attract_server/node_types/task.py @@ -9,60 +9,55 @@ node_type_task = { 'in_progress', 'on_hold', 'approved', - 'cbb', + 'cbb', # Could Be Better 'final', 'review' ], 'required': True, }, - 'filepath': { - 'type': 'string', + + # Links to external systems (filenames, SVN repository URLs, SVN revisions, etc.) + 'external_links': { + 'svn_revisions': { + 'type': 'list', + 'schema': { + 'type': 'dict', + } + }, }, - # TODO: describe what this is. - 'revision': { - 'type': 'integer', - }, - 'owners': { + + 'assigned_to': { 'type': 'dict', 'schema': { 'users': { 'type': 'list', 'schema': { - 'type': 'objectid', - } - }, - 'groups': { - 'type': 'list', - 'schema': { + # TODO: refer to user collection 'type': 'objectid', } } } }, + + # For Gantt charts and the like. 'time': { 'type': 'dict', 'schema': { - # TODO: include indication of _what_ start. - # At least make distinction between "planned" and "actual". - 'start': { + 'planned_start': { 'type': 'datetime' }, - # TODO: include units! - # TODO: include indication of _what_ duration. - # At least make distinction between "planned" and "actual". - 'duration': { + 'planned_duration_hours': { 'type': 'integer' }, 'chunks': { 'type': 'list', 'schema': { 'type': 'dict', - # TODO: same notes as above 'schema': { - 'start': { + 'planned_start': { 'type': 'datetime', }, - 'duration': { + 'planned_duration_hours': { 'type': 'integer', } } @@ -70,45 +65,12 @@ node_type_task = { }, } }, - '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': {}, + 'time': {'visible': False}, }, - 'parent': ['shot'] + + # TODO: is this None really needed? Check. + 'parent': [None, 'task', 'shot'] }