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