Commit 61b89012 authored by Vincent Pelletier's avatar Vincent Pelletier Committed by Sebastien Robin

SQLCatalog.getCatalogSearchTableIds: Simplify.

parent 98e6dbad
...@@ -1063,18 +1063,12 @@ class Catalog(Folder, ...@@ -1063,18 +1063,12 @@ class Catalog(Folder,
"""Return selected tables of catalog which are used in JOIN. """Return selected tables of catalog which are used in JOIN.
catalaog is always first catalaog is always first
""" """
search_tables = self.sql_search_tables search_tables = list(self.sql_search_tables) or ['catalog']
if len(search_tables) > 0: if search_tables[0] != 'catalog':
if search_tables[0] != 'catalog': search_tables = ['catalog'] + [x for x in search_tables if x != 'catalog']
result = ['catalog'] # XXX: cast to tuple to avoid a mutable persistent property ?
for t in search_tables: self.sql_search_tables = search_tables
if t != 'catalog': return search_tables
result.append(t)
self.sql_search_tables = result
else:
self.sql_search_tables = ['catalog']
return self.sql_search_tables
security.declarePublic('getCatalogSearchResultKeys') security.declarePublic('getCatalogSearchResultKeys')
def getCatalogSearchResultKeys(self): def getCatalogSearchResultKeys(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