Search code examples
pythonplonezopeplone-4.x

Why plone.api doesn’t have find?


I trying create a script to find a exist folder, if not create this folder.

But when a call find from plone.api the output is AttributeError: 'module' object has no attribute 'find'

Bellow my terminal:

$ bin/instance -O intranet debug
>>> from plone import api
>>> from zope.site.hooks import setSite
>>> portal = app['intranet']
>>> setSite(portal)
>>> folders = api.content.find(context=portal, portal_catalog='Folder')
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'module' object has no attribute 'find'
>>>

What is wrong in my case? I used this documentation plone.api.content.find


Solution

  • Need update plone.api to a version with support to method find. Like said by @LucaFabbri. In my case the product was update to 1.5.0.