[Zope] passing script parameters - newbie question

robert robert at redcor.ch
Sun Dec 28 12:03:26 EST 2003


try something like this:

obj = getattr(container, fileid, None)
if obj and obj.hasProperty('prop'):
	return obj.getProperty('prop')
return 'either object or property not found'

HTH
Robert
	
On Sunday 28 December 2003 10:11, Paul Dumais wrote:
> I have a Python script that takes a parameter 'fileid' which is a file
> id. I need to call the getProperty() method via something like this:
>
> container.fileid.getProperty('prop')
>
> This does not work (I get an Attribute Error).
>
> Can anyone help?
>
> Paul
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )




More information about the Zope mailing list