Commit 31f3bc44 authored by Aurel's avatar Aurel

distinguish key at install


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4888 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 04d67f7c
...@@ -1918,7 +1918,7 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem): ...@@ -1918,7 +1918,7 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem):
else: else:
raise NotFound, 'key %r not found in catalog' %(key,) raise NotFound, 'key %r not found in catalog' %(key,)
if len(key_list) > 0: if len(key_list) > 0:
self._objects[self.__class__.__name__+os.sep+'key_list'] = key_list self._objects[self.__class__.__name__+os.sep+'result_key_list'] = key_list
def _importFile(self, file_name, file): def _importFile(self, file_name, file):
list = [] list = []
...@@ -1951,9 +1951,9 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem): ...@@ -1951,9 +1951,9 @@ class CatalogResultKeyTemplateItem(BaseTemplateItem):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
force = kw.get('force') force = kw.get('force')
# XXX same as related key # XXX same as related key
if update_dict.has_key(key) or force: if update_dict.has_key('result_key_list') or force:
if not force: if not force:
action = update_dict[key] action = update_dict['result_key_list']
if action == 'nothing': if action == 'nothing':
return return
for key in keys: for key in keys:
...@@ -2017,7 +2017,7 @@ class CatalogRelatedKeyTemplateItem(BaseTemplateItem): ...@@ -2017,7 +2017,7 @@ class CatalogRelatedKeyTemplateItem(BaseTemplateItem):
else: else:
raise NotFound, 'key %r not found in catalog' %(key,) raise NotFound, 'key %r not found in catalog' %(key,)
if len(key_list) > 0: if len(key_list) > 0:
self._objects[self.__class__.__name__+os.sep+'key_list'] = key_list self._objects[self.__class__.__name__+os.sep+'related_key_list'] = key_list
def _importFile(self, file_name, file): def _importFile(self, file_name, file):
list = [] list = []
...@@ -2050,8 +2050,11 @@ class CatalogRelatedKeyTemplateItem(BaseTemplateItem): ...@@ -2050,8 +2050,11 @@ class CatalogRelatedKeyTemplateItem(BaseTemplateItem):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
force = kw.get('force') force = kw.get('force')
# XXX must a find a better way to manage related key # XXX must a find a better way to manage related key
if update_dict.has_key('key_list') or force: if update_dict.has_key('related_key_list') or update_dict.has_key('key_list') or force:
if not force: if not force:
if update_dict.has_key('related_key_list'):
action = update_dict['related_key_list']
else: # XXX for backward compatibility
action = update_dict['key_list'] action = update_dict['key_list']
if action == 'nothing': if action == 'nothing':
return return
...@@ -2116,7 +2119,7 @@ class CatalogResultTableTemplateItem(BaseTemplateItem): ...@@ -2116,7 +2119,7 @@ class CatalogResultTableTemplateItem(BaseTemplateItem):
else: else:
raise NotFound, 'key %r not found in catalog' %(key,) raise NotFound, 'key %r not found in catalog' %(key,)
if len(key_list) > 0: if len(key_list) > 0:
self._objects[self.__class__.__name__+os.sep+'key_list'] = key_list self._objects[self.__class__.__name__+os.sep+'resutl_table_list'] = key_list
def _importFile(self, file_name, file): def _importFile(self, file_name, file):
list = [] list = []
...@@ -2149,9 +2152,9 @@ class CatalogResultTableTemplateItem(BaseTemplateItem): ...@@ -2149,9 +2152,9 @@ class CatalogResultTableTemplateItem(BaseTemplateItem):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
force = kw.get('force') force = kw.get('force')
# XXX same as related keys # XXX same as related keys
if update_dict.has_key(key) or force: if update_dict.has_key('result_table_list') or force:
if not force: if not force:
action = update_dict[key] action = update_dict['result_table_list']
if action == 'nothing': if action == 'nothing':
return return
for key in keys: for key in keys:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment