Re: multiple scripts in After Validattion Script field

Nathan Van Gheem <[email protected]> Thu, 11 Jun 2015 19:55:17 -0500
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <CAL8hw9FyXMn7wWJFXCtVVRYn+xT+fLHMzoDBzBAw=-43a4XQng@mail.gmail.com>
SQL_createScanLogRow is a function call right? Should be
SQL_createScanLogRow()
On Jun 11, 2015 7:42 PM, "Chuck Theobald" <[email protected]> wrote:

>  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]>
> 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
>> F: 541-346-0345
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Plone-Users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>
>
>
> ------------------------------------------------------------------------------
>
>
>
> _______________________________________________
> Plone-Users mailing listPlone-Users-5NWGOfrQmneRv+LV9MX5ugtCRVl27V+i0wdF1cv0I5s@public.gmane.org://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
>
>

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

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