plone / plone.api

The Plone API
https://6.docs.plone.org/plone.api
Other
86 stars 53 forks source link

Add api.content.get_parents #531

Open davisagli opened 6 months ago

davisagli commented 6 months ago

It would be nice to provide an API for iterating through all of an object's parents. It can be implemented using Acquisition.aq_chain

Nice to have: Provide a way to filter the parents for ones that implement a particular interface or match a predicate. Provide a way to get the closest parent that matches these filters (if any).

yurj commented 2 months ago

https://community.plone.org/t/best-way-to-get-the-object-parent/19633

here some ideas and discussion. In particular we could add an option to get the parent with or without aq_inner.