Merge branch 'master' into permissions

This commit is contained in:
Eibriel
2015-07-03 09:01:16 -03:00
2 changed files with 56 additions and 18 deletions

View File

@@ -197,7 +197,7 @@ class ValidateCustomFields(Validator):
value = convert_properties(value, node_type['dyn_schema']) value = convert_properties(value, node_type['dyn_schema'])
except Exception, e: except Exception, e:
print ("Error converting: {0}".format(e)) print ("Error converting: {0}".format(e))
print (value) #print (value)
v = Validator(node_type['dyn_schema']) v = Validator(node_type['dyn_schema'])
val = v.validate(value) val = v.validate(value)

View File

@@ -45,6 +45,25 @@ def clear_db():
db.drop_collection('users') 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 @manager.command
def upgrade_node_types(): def upgrade_node_types():
"""Wipes node_types collection """Wipes node_types collection
@@ -242,26 +261,25 @@ def populate_node_types(old_ids={}):
}, },
"status": { "status": {
"type": "string", "type": "string",
"allowed": ["on_hold", "allowed": [
"todo", "on_hold",
"in_progress", "todo",
"review_required", "in_progress",
"final"], "review",
"final"
],
}, },
"notes": { "notes": {
"type": "string", "type": "string",
"maxlength": 256, "maxlength": 256,
}, },
"order": {
"type": "integer",
},
"shot_group": { "shot_group": {
"type": "string", "type": "string",
#"data_relation": { #"data_relation": {
# "resource": "nodes", # "resource": "nodes",
# "field": "_id", # "field": "_id",
#}, #},
} },
}, },
"form_schema": { "form_schema": {
"url": {}, "url": {},
@@ -269,7 +287,6 @@ def populate_node_types(old_ids={}):
"cut_out": {}, "cut_out": {},
"status": {}, "status": {},
"notes": {}, "notes": {},
"order": {},
"shot_group": {} "shot_group": {}
}, },
"parent": { "parent": {
@@ -285,15 +302,21 @@ def populate_node_types(old_ids={}):
"type": "string", "type": "string",
"allowed": [ "allowed": [
"todo", "todo",
"in-progress", "in_progress",
"done", "on_hold",
"approved",
"cbb", "cbb",
"final1", "final",
"final2",
"review" "review"
], ],
"required": True, "required": True,
}, },
"filepath": {
"type": "string",
},
"revision": {
"type": "integer",
},
"owners": { "owners": {
"type": "dict", "type": "dict",
"schema": { "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": { "form_schema": {
"status": {}, "status": {},
"filepath": {},
"revision": {},
"owners": { "owners": {
"schema": { "schema": {
"users":{ "users":{
"items": [('User', 'email')], "items": [('User', 'first_name')],
}, },
"groups":{} "groups": {}
} }
}, },
"time": { "time": {
@@ -359,7 +394,10 @@ def populate_node_types(old_ids={}):
} }
} }
} }
} },
"is_conflicting": {},
"is_open": {},
"is_processing": {},
}, },
"parent": { "parent": {
"node_types": ["shot"], "node_types": ["shot"],