From 174a626682442c7b8513117e91ba6b8e956b818d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Pin?= Date: Sat, 13 Nov 2010 11:38:27 +0100 Subject: [PATCH] =?utf8?q?Maj=20de=20various.py=20pour=20ajouter,=20si=20b?= =?utf8?q?esoin,=20les=20=C3=A9l=C3=A9ments=20'tile'=20et=20'image'.=20Ajo?= =?utf8?q?ut=20manuel=20de=20l'index=20'position',=20en=20attendant=20d'av?= =?utf8?q?oir=20fini=20de=20d=C3=A9velopp=C3=A9=20l'adaptateur=20de=20Prox?= =?utf8?q?yIndex=20pour=20GenericSetup.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- profiles/photo/various.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 -- 2.20.1