[Zope] AttributeError in python script

Trevor Toenjes zope@toenjes.com
Sat, 26 Jan 2002 17:22:10 -0500


> Trevor Toenjes writes:
> Apparently, you must be more careful, when you describe problems.
Agreed that I threw off the real issue with a sloppy mistake when copying my
example over to email.

> I already replied to an almost identical problem report, just
> with a small but essential difference...
>
>  > ##parameters=myFolder, myObjectType
>  > results=[]
>  > for object in container.myFolder.objectValues(myObjectType):
> 	         getattr(container,myFolder)
>
> This is called "Computed Attribute Access".
> You (and others) use it whenever an attribute it either not constant
> or not a (Python) name...

The following line tests properly in the script.
for object in context[myFolder].objectValues(myObjectType)  <<tests
correctly
It looks like this is an alternative to your suggestion.

The continuing issue is...now I am trying to call this tuple for a
Formulator Items property override.

I include the following for Items and get an AttributeError
tuple_of_items(emailscripts,'DTML Method')

My assumption is
- emailscripts is an object
- and DTML Method is a string
when processed in the script.
But I must still be calling it incorrectly.
Maybe Formulator can't populate Items with objects, so I need to convert the
id to strings?  But I thought the advantage of Formulator was to use objects
for use in HTML forms.

Thanks for the help.
Trevor