Re: [Zope3-Users] Object Widgets

2006-06-01 Thread Stephan Richter
On Tuesday 18 April 2006 10:44, Marco Mariani wrote:
 Should I set form_fields['photo'].custom_widget ? To what?

You have several choices, though this is a good one. I am not sure that there 
is an ImageWidget, but I think there is a file one. In one of my latest 
projects, we wrote some custom code, but we really should have something 
built in.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics  Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] object widgets, persistency

2005-05-01 Thread Andreas Reuleaux
To answer my own question - just for the record, in case
someone is having the same difficulties - I found redefining
__getstate__ in Family solved my problem:

...
from zope.security.proxy import removeSecurityProxy

class Family(Persistent):
...

def __getstate__(self):
s=Persistent.__getstate__(self)
s['mother']=removeSecurityProxy(self.mother)
s['father']=removeSecurityProxy(self.father)
return s


On Mon, Apr 25, 2005 at 11:42:25PM +0200, Andreas Reuleaux wrote:
 ... 
 Then I tried to make Family persistent, i. e. 
 
 from persistent import Persistent
 class Family(Persistent):
   ...
 
 and I learned subobjects should be persistent, too
 
 from persistent import Persistent
 class Person(Persistent)
   ...
 
 Now when I change family objects in the editform I can do so safely
 with foo and bar, but changing Mother's or Father's name results in an
 error:
 
 UnpickleableError: Cannot pickle type 'zope.security._proxy._Proxy' 
 objects
 
 The complete error log is shown below, too. - It seems to me that
 because one has to declare view- (rs. edit-) permissions for Person
 
 require permission=zope.View
   interface=.iperson.IPerson
 /
 
 Person is wrapped in a security proxy and therefore family can't be
 saved (pickeled) any more. - Any idea how to solve this?
 
 I don't have this problem if I only make Person persistent (not
 Family) but of course then I am losing changes to the family
 attributes foo and bar.
 ...
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users