Commit 97296bfd authored by Julien Muchembled's avatar Julien Muchembled

SQLCatalog: use set instead of dict without values

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36162 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d9f75517
...@@ -944,23 +944,20 @@ class Catalog(Folder, ...@@ -944,23 +944,20 @@ class Catalog(Folder,
@caching_instance_method(id='SQLCatalog.getColumnIds', @caching_instance_method(id='SQLCatalog.getColumnIds',
cache_factory='erp5_content_long') cache_factory='erp5_content_long')
def _getColumnIds(self): def _getColumnIds(self):
keys = {} keys = set()
add_key = keys.add
for table in self.getCatalogSearchTableIds(): for table in self.getCatalogSearchTableIds():
field_list = self._getCatalogSchema(table=table) field_list = self._getCatalogSchema(table=table)
for field in field_list: for field in field_list:
keys[field] = None add_key(field)
keys['%s.%s' % (table, field)] = None # Is this inconsistent ? add_key('%s.%s' % (table, field)) # Is this inconsistent ?
for related in self.getSQLCatalogRelatedKeyList(): for related in self.getSQLCatalogRelatedKeyList():
related_tuple = related.split('|') related_tuple = related.split('|')
related_key = related_tuple[0].strip() add_key(related_tuple[0].strip())
keys[related_key] = None
for scriptable in self.getSQLCatalogScriptableKeyList(): for scriptable in self.getSQLCatalogScriptableKeyList():
scriptable_tuple = scriptable.split('|') scriptable_tuple = scriptable.split('|')
scriptable = scriptable_tuple[0].strip() add_key(scriptable_tuple[0].strip())
keys[scriptable] = None return sorted(keys)
keys = keys.keys()
keys.sort()
return keys
def getColumnIds(self): def getColumnIds(self):
""" """
......
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