Commit 0ac23f1c by Julien Muchembled

CategoryTool: remove broken/unused getRelatedValueList parameters

1 parent 9b022399
...@@ -1278,7 +1278,6 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1278,7 +1278,6 @@ class CategoryTool( UniqueObject, Folder, Base ):
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getRelatedValueList' ) 'getRelatedValueList' )
def getRelatedValueList(self, context, base_category_list=None, def getRelatedValueList(self, context, base_category_list=None,
spec=(), filter=None, base=1,
checked_permission=None, **kw): checked_permission=None, **kw):
""" """
This methods returns the list of objects related to the context This methods returns the list of objects related to the context
...@@ -1289,9 +1288,6 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1289,9 +1288,6 @@ class CategoryTool( UniqueObject, Folder, Base ):
if isinstance(portal_type, str): if isinstance(portal_type, str):
portal_type = [portal_type] portal_type = [portal_type]
if spec is ():
# We do not want to care about spec
spec = None
# Base Category may not be related, besides sub categories # Base Category may not be related, besides sub categories
if context.getPortalType() == 'Base Category': if context.getPortalType() == 'Base Category':
...@@ -1305,16 +1301,10 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1305,16 +1301,10 @@ class CategoryTool( UniqueObject, Folder, Base ):
for base_category in base_category_list: for base_category in base_category_list:
category_list.append("%s/%s" % (base_category, context.getRelativeUrl())) category_list.append("%s/%s" % (base_category, context.getRelativeUrl()))
sql_kw = {}
for sql_key in ('limit', 'order_by_expression'): # XXX-JPS it would be better to use Catalog API
if sql_key in kw:
sql_kw[sql_key] = kw[sql_key]
brain_result = self.Base_zSearchRelatedObjectsByCategoryList( brain_result = self.Base_zSearchRelatedObjectsByCategoryList(
category_list=category_list, category_list=category_list,
portal_type=portal_type, portal_type=portal_type,
strict_membership=strict_membership, strict_membership=strict_membership)
**sql_kw)
result = [] result = []
if checked_permission is None: if checked_permission is None:
...@@ -1345,8 +1335,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1345,8 +1335,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
security.declareProtected( Permissions.AccessContentsInformation, security.declareProtected( Permissions.AccessContentsInformation,
'getRelatedPropertyList' ) 'getRelatedPropertyList' )
def getRelatedPropertyList(self, context, base_category_list=None, def getRelatedPropertyList(self, context, base_category_list=None,
property_name=None, spec=(), property_name=None,
filter=None, base=1,
checked_permission=None, **kw): checked_permission=None, **kw):
""" """
This methods returns the list of property_name on objects This methods returns the list of property_name on objects
...@@ -1355,8 +1344,7 @@ class CategoryTool( UniqueObject, Folder, Base ): ...@@ -1355,8 +1344,7 @@ class CategoryTool( UniqueObject, Folder, Base ):
result = [] result = []
for o in self.getRelatedValueList( for o in self.getRelatedValueList(
context=context, context=context,
base_category_list=base_category_list, spec=spec, base_category_list=base_category_list,
filter=filter, base=base,
checked_permission=checked_permission, **kw): checked_permission=checked_permission, **kw):
result.append(o.getProperty(property_name, None)) result.append(o.getProperty(property_name, None))
return result return result
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!