training icon indicating copy to clipboard operation
training copied to clipboard

Is to_path efficiency note correct?

Open idgserpro opened this issue 7 years ago • 4 comments

In Accessing and displaying related items, it says:

We use :py:meth:rel.to_path and use the items path to query the catalog for its catalog-entry. This is much more efficient than using :py:meth:rel.to_object since we don't have to wake up any objects. Setting depth to 0 will only return items with exactly this path, so it will always return a list with one item.

Is that really correct? I see that to_path calls to_object.

idgserpro avatar Jun 29 '18 21:06 idgserpro

@pbauer FYI.

idgserpro avatar Jun 29 '18 21:06 idgserpro

@pbauer can you check this? I can confirm that using to_path is worse than using to_object.

idgserpro avatar Aug 21 '18 14:08 idgserpro

Thanks for the feedback. Would you like to cerate a pull-request for this chapter?

pbauer avatar Aug 21 '18 15:08 pbauer

@pbauer I'm out of time now. But I think that example would be better:

https://github.com/plone/plone.app.dexterity/blob/82bba1e369d7a2678f358b7ffa2b9fc873429afc/docs/advanced/references.rst#back-references

idgserpro avatar Aug 21 '18 15:08 idgserpro