-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
Description
@thet @agitator
I would like manipulate the custom query in the Collectionish Collection Object. I implement, in a local branch of this package, a hook via adapter registration. The rest of the manipulation is in my own addon.
# interfaces.py
class ICustomQueryModifier(Interface):
"""adapter interface for modifying the custom query"""
def transformQuery(self, custom_query):
"""transform the query
@return: a new custom query
"""
@implementer(ICollectionish)
class CollectionishCollection(object):
....
def results(self, custom_query, request_params):
# Hook to customize the custom_query
qm = queryMultiAdapter((self,), ICustomQueryModifier)
if qm is not None:
custom_query = qm.transformQuery(custom_query)
return self.collection.results(
batch=False, brains=True, custom_query=custom_query
)
My Question, is such extension needed, wanted, possible, tolerate or permitted if i make a PR with this changes?