From: Benoît Pin Date: Sat, 13 Nov 2010 10:38:27 +0000 (+0100) Subject: Maj de various.py pour ajouter, si besoin, les éléments 'tile' et 'image'. Ajout... X-Git-Url: https://scm.cri.mines-paristech.fr/git/Plinn.git/commitdiff_plain/174a626682442c7b8513117e91ba6b8e956b818d?ds=inline;hp=--cc Maj de various.py pour ajouter, si besoin, les éléments 'tile' et 'image'. Ajout manuel de l'index 'position', en attendant d'avoir fini de développé l'adaptateur de ProxyIndex pour GenericSetup. --- 174a626682442c7b8513117e91ba6b8e956b818d diff --git a/profiles/photo/various.py b/profiles/photo/various.py index 8141a6d..819cc4b 100644 --- a/profiles/photo/various.py +++ b/profiles/photo/various.py @@ -102,13 +102,16 @@ caltool = getToolByName(site, 'portal_calendar') caltool.configureTool(['created', 'modified', 'DateTimeOriginal'], [9, 18]) pimtool = getToolByName(site, 'portal_image_manipulation') -pimtool.manage_addProduct['OFSP'].manage_addFolder('image') -pimtool.manage_addProduct['OFSP'].manage_addFolder('tile') +if not pimtool.hasObject('image') : + pimtool.manage_addProduct['OFSP'].manage_addFolder('image') +if not pimtool.hasObject('tile') : + pimtool.manage_addProduct['OFSP'].manage_addFolder('tile') ctool = getToolByName(site, 'portal_catalog') -ctool.manage_addProduct['ProxyIndex'].manage_addProxyIndex('position', - extra = { 'idx_type' : 'FieldIndex' - , 'value_expr' : 'python:object.getParentNode().getObjectPosition(object.getId())'}) +if not 'position' in ctool.indexes() : + ctool.manage_addProduct['ProxyIndex'].manage_addProxyIndex('position', + extra = { 'idx_type' : 'FieldIndex' + , 'value_expr' : 'python:object.getParentNode().getObjectPosition(object.getId())'}) # Caches HTTPCache = site.HTTPCache