Commit 22140f6e authored by Jérome Perrin's avatar Jérome Perrin

Convert properties to string when importing

Call getSqlCatalogRelatedKeyList in getColumnIds



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6975 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4c7016dc
...@@ -523,7 +523,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -523,7 +523,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
value = '' value = ''
for text in prop.childNodes: for text in prop.childNodes:
if text.nodeType == text.TEXT_NODE: if text.nodeType == text.TEXT_NODE:
value = text.data value = str(text.data)
break break
else: else:
value = [] value = []
...@@ -533,7 +533,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -533,7 +533,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
raise CatalogError, 'unknown item type %r' % (item_type,) raise CatalogError, 'unknown item type %r' % (item_type,)
for text in item.childNodes: for text in item.childNodes:
if text.nodeType == text.TEXT_NODE: if text.nodeType == text.TEXT_NODE:
value.append(text.data) value.append(str(text.data))
break break
value = tuple(value) value = tuple(value)
...@@ -542,7 +542,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -542,7 +542,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
if not hasattr(self, 'filter_dict'): if not hasattr(self, 'filter_dict'):
self.filter_dict = PersistentMapping() self.filter_dict = PersistentMapping()
for filt in root.getElementsByTagName("filter"): for filt in root.getElementsByTagName("filter"):
id = filt.getAttribute("id") id = str(filt.getAttribute("id"))
expression = filt.getAttribute("expression") expression = filt.getAttribute("expression")
if not self.filter_dict.has_key(id): if not self.filter_dict.has_key(id):
self.filter_dict[id] = PersistentMapping() self.filter_dict[id] = PersistentMapping()
...@@ -716,7 +716,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -716,7 +716,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
for field in field_list: for field in field_list:
keys[field] = 1 keys[field] = 1
keys['%s.%s' % (table, field)] = 1 # Is this inconsistent ? keys['%s.%s' % (table, field)] = 1 # Is this inconsistent ?
for related in self.sql_catalog_related_keys: for related in self.getSqlCatalogRelatedKeyList():
related_tuple = related.split('|') related_tuple = related.split('|')
related_key = related_tuple[0].strip() related_key = related_tuple[0].strip()
keys[related_key] = 1 keys[related_key] = 1
......
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