Removed order from dyn_schema, added remove_properties_order script

This commit is contained in:
Eibriel 2015-05-28 13:21:50 -03:00
parent 80c019c921
commit 4d8acde94c

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
@ -103,9 +122,6 @@ def populate_node_types(old_ids={}):
# "field": "_id", # "field": "_id",
#}, #},
}, },
"order": {
"type": "integer",
}
}, },
"form_schema": { "form_schema": {
"url": {}, "url": {},
@ -113,7 +129,6 @@ def populate_node_types(old_ids={}):
"cut_out": {}, "cut_out": {},
"status": {}, "status": {},
"notes": {}, "notes": {},
"order": {},
"shot_group": {} "shot_group": {}
}, },
"parent": { "parent": {