[Zope] assignment to form records
Fernando Martins
fmartins@hetnet.nl
Sat, 8 Mar 2003 19:37:07 +0100
> From: Dieter Maurer [mailto:dieter@handshake.de]
> Fernando Martins wrote at 2003-3-7 00:04 +0100:
> > ObjFields = Products.PythonScripts.standard.Object()
> > ObjFields = Fields
> > ObjFields.a_field = 10
> >
> > and I got the same error:
> >
> > > Error Type: TypeError
> > > Error Value: attribute-less object (assign or del)
>
> Sure, as you still work with the same object...
>
> After "ObjFields = Fields", "ObjFields contains "Fields" and
> no longer the newly created "Object()".
Doh! I should have thought about that!
So, in Python, Fields is a memory pointer and Fields.a_field is the same as
Fields->a_field in C.
It seems what I need is shallow copy from the copy module, and I can't in
Scripts. Oh well, anyway, I'm now using Evan's patch.
Thanks,
Fernando