Renamed project picture properties

This commit is contained in:
2015-09-11 21:15:10 +02:00
parent 3f06fa7b7a
commit 7d950d8fef

View File

@@ -521,7 +521,7 @@ def populate_node_types(old_ids={}):
} }
}, },
# Logo # Logo
'picture_1': { 'picture_square': {
'type': 'objectid', 'type': 'objectid',
'nullable': True, 'nullable': True,
'data_relation': { 'data_relation': {
@@ -531,7 +531,7 @@ def populate_node_types(old_ids={}):
}, },
}, },
# Header # Header
'picture_2': { 'picture_header': {
'type': 'objectid', 'type': 'objectid',
'nullable': True, 'nullable': True,
'data_relation': { 'data_relation': {
@@ -547,8 +547,8 @@ def populate_node_types(old_ids={}):
'category': {}, 'category': {},
'url': {}, 'url': {},
'organization': {}, 'organization': {},
'picture_1': {}, 'picture_square': {},
'picture_2': {}, 'picture_header': {},
'owners': { 'owners': {
'schema': { 'schema': {
'users':{ 'users':{
@@ -662,7 +662,7 @@ def populate_node_types(old_ids={}):
# upgrade(scene_node_type, old_ids) # upgrade(scene_node_type, old_ids)
# upgrade(act_node_type, old_ids) # upgrade(act_node_type, old_ids)
# upgrade(comment_node_type, old_ids) # upgrade(comment_node_type, old_ids)
# upgrade(project_node_type, old_ids) upgrade(project_node_type, old_ids)
upgrade(asset_node_type, old_ids) upgrade(asset_node_type, old_ids)
@@ -869,14 +869,14 @@ def import_data(path):
node_type_project = db.node_types.find_one({"name": "project"}) node_type_project = db.node_types.find_one({"name": "project"})
node['node_type'] = node_type_project['_id'] node['node_type'] = node_type_project['_id']
parent = None parent = None
if node['properties'].get('picture_1'): if node['properties'].get('picture_square'):
picture = [p for p in d['files_group'] if p['name'] == node['properties']['picture_1'][:-4]][0] picture = [p for p in d['files_group'] if p['name'] == node['properties']['picture_square'][:-4]][0]
node['properties']['picture_1'] = picture['_id'] node['properties']['picture_square'] = picture['_id']
print "Adding picture_1 link to node" print "Adding picture_square link to node"
if node['properties'].get('picture_2'): if node['properties'].get('picture_header'):
picture = [p for p in d['files_group'] if p['name'] == node['properties']['picture_2'][:-4]][0] picture = [p for p in d['files_group'] if p['name'] == node['properties']['picture_header'][:-4]][0]
node['properties']['picture_2'] = picture['_id'] node['properties']['picture_header'] = picture['_id']
print "Adding picture_2 link to node" print "Adding picture_header link to node"
else: else:
# Get the parent node id # Get the parent node id
parents_list_node_id = parents_list[tree_index - 1] parents_list_node_id = parents_list[tree_index - 1]