Commit 530ffd79 authored by Vincent Pelletier's avatar Vincent Pelletier

ZSQLCatalog: Drop a few single-use locals.

parent 129f97e3
...@@ -1097,8 +1097,7 @@ class Catalog(Folder, ...@@ -1097,8 +1097,7 @@ class Catalog(Folder,
keys = set() keys = set()
add_key = keys.add add_key = keys.add
for table in self.getCatalogSearchTableIds(): for table in self.getCatalogSearchTableIds():
field_list = self._getCatalogSchema(table=table) for field in self._getCatalogSchema(table=table):
for field in field_list:
add_key(field) add_key(field)
add_key('%s.%s' % (table, field)) # Is this inconsistent ? add_key('%s.%s' % (table, field)) # Is this inconsistent ?
for related in self.getSQLCatalogRelatedKeyList(): for related in self.getSQLCatalogRelatedKeyList():
...@@ -1143,14 +1142,11 @@ class Catalog(Folder, ...@@ -1143,14 +1142,11 @@ class Catalog(Folder,
Calls the show column method and returns dictionnary of Calls the show column method and returns dictionnary of
Field Ids Field Ids
""" """
keys = {} keys = set()
for table in self.getCatalogSearchTableIds(): for table in self.getCatalogSearchTableIds():
field_list = self._getCatalogSchema(table=table) for field in self._getCatalogSchema(table=table):
for field in field_list: keys.add('%s.%s' % (table, field))
keys['%s.%s' % (table, field)] = 1 return sorted(keys)
keys = keys.keys()
keys.sort()
return keys
@transactional_cache_decorator('SQLCatalog.getSortColumnIds') @transactional_cache_decorator('SQLCatalog.getSortColumnIds')
@caching_instance_method(id='SQLCatalog.getSortColumnIds', @caching_instance_method(id='SQLCatalog.getSortColumnIds',
...@@ -1162,14 +1158,11 @@ class Catalog(Folder, ...@@ -1162,14 +1158,11 @@ class Catalog(Folder,
Calls the show column method and returns dictionnary of Calls the show column method and returns dictionnary of
Field Ids that can be used for a sort Field Ids that can be used for a sort
""" """
keys = {} keys = set()
for table in self.getTableIds(): for table in self.getTableIds():
field_list = self._getCatalogSchema(table=table) for field in self._getCatalogSchema(table=table):
for field in field_list: keys.add('%s.%s' % (table, field))
keys['%s.%s' % (table, field)] = 1 return sorted(keys)
keys = keys.keys()
keys.sort()
return keys
def getTableIds(self): def getTableIds(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