[Zope] question on setting PropertySheet value from External Method

Tim Lynch lynch@gould.mannlib.cornell.edu
Fri, 14 Dec 2001 16:23:09 EST


Thanks Dieter,

As you might have seen by now from a second message to the list, I did manage to solve
this problem. But to follow up your email.

yes, I do have a propertysheet named Basic.  I did try the alternative syntax:
 propertysheets.Basic  at one point, but not since I fixed the problem by changing
how I passed the the Title value from Title = t (which didn't work) to
{'Title':t} (which does work).  What I'm using now is propertysheets['Basic'] and
that does work.

I got the "Title = t" syntax from an example posted back in April I believe.  The
write said it worked for him, but I had no luck.

Actually, what I've got working now is:

   self.resources[recordID].propertysheets.Basic.manage_changeProperties({'Title':t,
                                                                          'Description':d})

Title is of type string and Description of type text.  My propertysheet has other
properties of type token, lines, and date. Once I'm able to update all properties via
the external method, I'll post a final note on my experience -- hopefully it'll save
other newbies some head scratching.

thanks again!

Tim


> Tim Lynch writes:
>  > But, when I try to change the Title property with:
>  > 
>  >    self.resources[recordID].propertysheets['Basic'].manage_changeProperties(Title = t)
>  > 
>  > I get TypeError -- sequence index must be integer
> This probably comes from "propertysheets['Basic']".
> 
> Try the attribute access syntax: "propertysheets.Basic".
> 
> But, do you have a propertysheet named "Basic" ?.
> If not, you will get an "AttributeError".
> 
> 
> Dieter
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )