Re: multiple scripts in After Validattion Script field

Chuck Theobald <[email protected]> Thu, 11 Jun 2015 17:43:27 -0700
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
Thanks, Steve, but will this work on a Z SQL Method? I created a 
wrapping script, callMe, containing:

context.prepareForExport()
request = container.REQUEST
date = request.form['principal-investigator']
return context.SQL_createScanLogRow

and set the After Validation Script to:

python:folder.callMe()

This correctly calls prepareForExport but does not do anything about the 
SQL_createScanLogRow. I commented out the return in prepareForExport, 
but still no records are written to the database.

I have confirmed that createScanLogRow works if used alone as an 
AfterValidationScript.

Chuck


On 06/11/2015 02:53 PM, Steve McMahon wrote:
> Just write a script that calls both of the others.
>
> result = context.my_script()
>
> will call "my_script" on context and save the result.
>
> On Thu, Jun 11, 2015 at 2:43 PM, Chuck Theobald <[email protected] 
> <mailto:[email protected]>> wrote:
>
>     Plone 4.3.3, PFG 1.7.16
>
>     I am using an After Validation Script to do some calculations
>     based on a
>     few fields and writing the results to other fields. Now I want to
>     store
>     data in a database through a Z SQL Method per the PFG SQL CRUD
>     tutorial
>     at
>     (http://docs.plone.org/5/en/working-with-content/managing-content/ploneformgen/sql_crud.html).
>     I have this working great stand-alone, but need to combine it with the
>     calculation script.
>
>     I've tried putting "python:folder.prepareForExport();
>     here/SQL_createScanLogRow" into the After Validation Script, but this
>     produces an error. How would I run both routines for After Validation?
>
>     Alternatively, is there a way to invoke a Z SQL Method from within the
>     python script?
>
>     Thanks
>
>     --
>     Chuck Theobald
>     System Administrator
>     The Robert and Beverly Lewis Center for Neuroimaging
>     University of Oregon
>     P: 541-346-0343 <tel:541-346-0343>
>     F: 541-346-0345 <tel:541-346-0345>
>
>
>     ------------------------------------------------------------------------------
>     _______________________________________________
>     Plone-Users mailing list
>     [email protected]
>     <mailto:[email protected]>
>     https://lists.sourceforge.net/lists/listinfo/plone-users
>
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Plone-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/plone-users

-- 
Chuck Theobald
System Administrator
The Robert and Beverly Lewis Center for Neuroimaging
University of Oregon
P: 541-346-0343
F: 541-346-0345

------------------------------------------------------------------------------

_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users