2017-01-24 16 views
1

이 폴더를 만들지 않으면 존재하는 폴더를 찾기 위해 스크립트를 만들려고합니다.plone.api에 찾을 수없는 이유는 무엇입니까?

그러나 plone.api에서 전화 find 출력 내 터미널 벨로 AttributeError: 'module' object has no attribute 'find'

때 :

$ 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' 
>>> 

내 경우에는 어떤 문제가 있습니까? 이 설명서를 사용했습니다 plone.api.content.find

+1

'api.content.find'가 어느 시점에 추가되었습니다. 어쩌면 이전 버전을 사용하고 있습니까? –

+0

@LucaFabbri in'/ eggs/plone.api-1.1.0-py2.7.egg/EGG-INFO' 필자는이 'Name : plone.api Version : 1.1.0'을 pypi에두고 최신 버전은'1.5'입니다. . 나는 업로드로 진행할 것이고, 나는 여기에 게시 할 결과를 얻을 것이다. 고마워! –

+0

네 말이 맞아. 나는 1.5로 업 그레 이드되어 그의 결과물은 두뇌 다. 고마워! –

답변

1

plone.api을 메소드 검색을 지원하는 버전으로 업데이트해야합니다. @ LucaFabbri에 의해 말했다. 내 경우 제품은 1.5.0으로 업데이트되었습니다.