diff --git a/attract/application/__init__.py b/attract/application/__init__.py index 886435e2..9b3edd13 100644 --- a/attract/application/__init__.py +++ b/attract/application/__init__.py @@ -197,7 +197,7 @@ class ValidateCustomFields(Validator): value = convert_properties(value, node_type['dyn_schema']) except Exception, e: print ("Error converting: {0}".format(e)) - print (value) + #print (value) v = Validator(node_type['dyn_schema']) val = v.validate(value) diff --git a/attract/manage.py b/attract/manage.py index 1e3a3fd9..845e5a18 100644 --- a/attract/manage.py +++ b/attract/manage.py @@ -45,6 +45,25 @@ def clear_db(): db.drop_collection('users') +@manager.command +def remove_properties_order(): + """Removes properties.order + """ + from pymongo import MongoClient + client = MongoClient() + db = client.eve + nodes = db.nodes.find() + for node in nodes: + new_prop = {} + for prop in node['properties']: + if prop == 'order': + continue + else: + new_prop[prop] = node['properties'][prop] + db.nodes.update({"_id": node['_id']}, + {"$set": {"properties": new_prop}}) + + @manager.command def upgrade_node_types(): """Wipes node_types collection @@ -242,26 +261,25 @@ def populate_node_types(old_ids={}): }, "status": { "type": "string", - "allowed": ["on_hold", - "todo", - "in_progress", - "review_required", - "final"], + "allowed": [ + "on_hold", + "todo", + "in_progress", + "review", + "final" + ], }, "notes": { "type": "string", "maxlength": 256, }, - "order": { - "type": "integer", - }, "shot_group": { "type": "string", #"data_relation": { # "resource": "nodes", # "field": "_id", #}, - } + }, }, "form_schema": { "url": {}, @@ -269,7 +287,6 @@ def populate_node_types(old_ids={}): "cut_out": {}, "status": {}, "notes": {}, - "order": {}, "shot_group": {} }, "parent": { @@ -285,15 +302,21 @@ def populate_node_types(old_ids={}): "type": "string", "allowed": [ "todo", - "in-progress", - "done", + "in_progress", + "on_hold", + "approved", "cbb", - "final1", - "final2", + "final", "review" ], "required": True, }, + "filepath": { + "type": "string", + }, + "revision": { + "type": "integer", + }, "owners": { "type": "dict", "schema": { @@ -335,16 +358,28 @@ def populate_node_types(old_ids={}): } }, } + }, + "is_conflicting" : { + "type": "boolean" + }, + "is_processing" : { + "type": "boolean" + }, + "is_open" : { + "type": "boolean" } + }, "form_schema": { "status": {}, + "filepath": {}, + "revision": {}, "owners": { "schema": { "users":{ - "items": [('User', 'email')], + "items": [('User', 'first_name')], }, - "groups":{} + "groups": {} } }, "time": { @@ -359,7 +394,10 @@ def populate_node_types(old_ids={}): } } } - } + }, + "is_conflicting": {}, + "is_open": {}, + "is_processing": {}, }, "parent": { "node_types": ["shot"],