[Zope-it] Metodi esterni
Aldo Bergamini
aaberga@nb-a.com
Wed, 26 Mar 2003 18:34:49 +0100
Avete presente la API di Zope dell'appendice B dello Zope Book=3F
Oggi mi sono lanciato nel tentativo di usare il methodo
unrestrictedTraverse (nella release 2.5 =E8 a pagina 312).
Ora giustamente il server Zope mi ha mandato a quel paese perch=E8 il primo
tentativo lo ho fatto da uno script Zope via ZMI.
Ok, devo usare un metodo esterno.
Solo che non so come/da dove importare il metodo in questione.
Il seguente sorgente:
>import ObjectManagerItem
>
>
>def getActiveCentres(StudyURL):
> =09return ObjectManagerItem.unrestr
ictedTraverse(StudyURL).objectValues(('Folder'))
genera il seguente errore.
>Site Error
>
>An error was encountered while publishing this resource.
>
>ImportError
>Sorry, a site error occurred.
>
>Traceback (innermost last):
>
> * Module ZPublisher.Publish, line 150, in publish=5Fmodule
> * Module Products.Localizer, line 58, in new=5Fpublish
> * Module ZPublisher.Publish, line 114, in publish
> * Module Zope.App.startup, line 182, in zpublisher=5Fexception=5Fhook
> * Module ZPublisher.Publish, line 98, in publish
> * Module ZPublisher.mapply, line 88, in mapply
> * Module ZPublisher.Publish, line 39, in call=5Fobject
> * Module Products.ExternalMethod.ExternalMethod, line 59, in
>manage=5FaddExternalMethod
> * Module Products.ExternalMethod.ExternalMethod, line 110, in =
=5F=5Finit=5F=5F
> * Module Products.ExternalMethod.ExternalMethod, line 133, in =
manage=5Fedit
> * Module Products.ExternalMethod.ExternalMethod, line 140, in =
getFunction
> * Module App.Extensions, line 144, in getObject
> =5F=5Ftraceback=5Finfo=5F=5F: ('/Applications/Plone/Zope/Extensions/
>StudyTracker.py', 'StudyTracker')
> * Module /Applications/Plone/Zope/Extensions/StudyTracker.py, line
1, in =3F
>
>ImportError: No module named ObjectManagerItem (Also, an error occurred
>while attempting to render the standard error message.)
>
>Troubleshooting Suggestions
>
> * The URL may be incorrect.
> * The parameters passed to this resource may be incorrect.
> * A resource that this resource relies on may be encountering an error.
>
>For more detailed information about the error, please refer to the HTML
>source for this page.
>
>If the error persists please contact the site maintainer. Thank you for
>your patience.
Ho guardato sui libri che ho, ma non ho cavato alcunch=E8 ... Dove posso
trovare una lista di metodi/oggetti di utilit=E0 da importare in propri
script esterni=3F
GRAZIE
Ciao
Aldo