Juliano Araújo
Juliano Araújo

Reputation: 3608

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

Upvotes: 1

Views: 108

Answers (1)

Juliano Ara&#250;jo
Juliano Ara&#250;jo

Reputation: 3608

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.

Upvotes: 1

Related Questions