Commit 0c4f86f4 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

If both a related key and a real column are found in getColumnSearchKey(), now...

If both a related key and a real column are found in getColumnSearchKey(), now the related key is used, because adding a related key with the same name should be done by the explicit intention to override the behaviour.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40012 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 369095f0
...@@ -1951,20 +1951,19 @@ class Catalog(Folder, ...@@ -1951,20 +1951,19 @@ class Catalog(Folder,
Also return a related key definition string with following rules: Also return a related key definition string with following rules:
- If returned SearchKey is a RelatedKey, value is its definition - If returned SearchKey is a RelatedKey, value is its definition
- Otherwise, value is None - Otherwise, value is None
If both a related key and a real column are found, the related key
is used.
""" """
# Is key a "real" column or some related key ? # Is key a related key or a "real" column ?
related_key_definition = None related_key_definition = self.getRelatedKeyDefinition(key)
if key in self.getColumnMap(): if related_key_definition is None:
search_key = self.getSearchKey(key, search_key_name) if key in self.getColumnMap():
else: search_key = self.getSearchKey(key, search_key_name)
# Maybe a related key...
related_key_definition = self.getRelatedKeyDefinition(key)
if related_key_definition is None:
# Unknown
search_key = None
else: else:
# It's a related key search_key = None
search_key = self.getSearchKey(key, 'RelatedKey') else:
search_key = self.getSearchKey(key, 'RelatedKey')
return search_key, related_key_definition return search_key, related_key_definition
def hasColumn(self, column): def hasColumn(self, column):
......
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