Commit 61bf44bc authored by Łukasz Nowak's avatar Łukasz Nowak

Support relation by relative_url too.

Using uid in some cases can result in joins with not supported tables, so allow
to configure category level constraint check in order to cover all cases.
parent d91f2431
......@@ -67,8 +67,12 @@ class CategoryRelatedMembershipArityConstraint(CategoryMembershipArityConstraint
# a string
assert len(base_category_list) != 0
sql_kw = {'portal_type': portal_type_list,
'%s_uid' % base_category_list[0]: obj.getUid()}
base_category = base_category_list[0]
sql_kw = {'portal_type': portal_type_list}
if base_category.endswith('_relative_url'):
sql_kw['%s' % base_category] = obj.getRelativeUrl()
else:
sql_kw['%s_uid' % base_category_list[0]] = obj.getUid()
sql_kw.update(self._getExpressionValue(obj, self.getFilterParameter()))
......
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