Commit 68c3552c authored by Vincent Pelletier's avatar Vincent Pelletier

Remove magic columns special case.

If a column is explicitly resolved to a table, it cannot be resolved to
another later. This causes problems when writing a related key targeting
another table with the same column name.
This code duplicates work done in the (only) caller (in
SearchKey/RelatedKey.py), as it already registers the latest relation
table with the column to apply on it.
parent c844be68
...@@ -166,14 +166,6 @@ class ColumnMap(object): ...@@ -166,14 +166,6 @@ class ColumnMap(object):
self.related_key_dict[real_related_column] = (group, column) self.related_key_dict[real_related_column] = (group, column)
self.registerColumn(column, group=group) self.registerColumn(column, group=group)
self.related_group_dict[group] = related_column self.related_group_dict[group] = related_column
# XXX: hardcoded translation table column names: they are not present in sql_catalog.getColumnMap(), and this table cannot be joined by uid, forbidding implicit join.
if column in ('translated_message', 'language', 'message_context', 'original_message'):
self.registerTable('translation', group=group)
self.resolveColumn(column, 'translation', group=group)
# Likewise, for measure table. Moreover, there is a related key named the same way as a column of that table (designed to do the join).
elif column in ('metric_type_uid', ):
self.registerTable('measure', group=group)
self.resolveColumn(column, 'measure', group=group)
return group return group
@profiler_decorator @profiler_decorator
......
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