[Zope-dev] Reg. persisting data in ZODB via forms

Joe Steeve js at hipro.co.in
Wed Jun 8 05:05:49 EDT 2011


Hello Charlie,

On Wed, 2011-06-08 at 10:48 +0200, Charlie Clark wrote:
> From memory I can recall something similar related to making changes
> to copies of instance attributes but failing to apply them to
> attributes and needing to specifically go context.attribute =
> form_result for the changes to persist.

Supposing, we have a form action like:

        @form.action('Apply')
        def handle_edit(self, action, data):
        	self.context.name += "Blah"
        
This change is visible in subsequent requests. i.e if we view this
object via another form, we can see the modification. However, if we
restart the server (bluebream), this change is lost. The same thing
happens when we use "form.applyData". If we 'notify'
ObjectModifiedEvent, this does not happen.

Since the object's modification is visible across requests, I am
assuming that the transaction mechanism 'did' apply the changes to the
object.

But, it did not get to the disk :-/

-- 
Joe Steeve
HiPro IT Solutions Pvt. Ltd.
http://hipro.co.in/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20110608/0ee20855/attachment.bin 


More information about the Zope-Dev mailing list