[Zope] Re: assignment to form records

Fernando Martins fmartins@hetnet.nl
Fri, 7 Mar 2003 01:26:39 +0100


Ah! Here it is ;-)

If this patch doesn't go into CVS, I'm willing to submit it to zope labs for
you, if you don't mind.

Albeit Dieter Maurer's solution is non-intrusive to Zope (after I get it to
work) this one makes it transparent for the (script) user ;-)

Cheers,
Fernando


Evan Simpson wrote:
> Fernando Martins wrote:
> > I've a script who gets two parameters from a form: Code (int), Fields
> > (record).
> ...
> > Fields.a_field = 1
> >
> > I get the error
>
> I routinely patch Zope so that 'record' instances and the SQL Record
> subclasses that it generates are writable:
>
> (in $ZOPE/lib/python/ZPublisher/HTTPRequest.py)
> class record:
>      # Allow access to record methods and values from DTML
>      __allow_access_to_unprotected_subobjects__=1
>      _guarded_writes = 1
>
> (in $ZOPE/lib/python/Shared/DC/ZRDB/Result.py)
>          class r(Record, Implicit, brains, zbrains):
>              'Result record class'
>              _guarded_writes = 1
>
> I see no reason why 'record' objects shouldn't be mutable like this, but
> I've never discussed it with anyone.
>
> Cheers,
>
> Evan @ 4-am
>
>
>
> _______________________________________________
> Zope maillist  -  Zope@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 )