Here's the scenario:

1. "insertNew" is a Z SQL Method for creating a new record in pgsql "table1"
Argument list = field1, field2, field3

SQL Query:
INSERT INTO table1 (field1, field2, field3)
    <dtml-sqlvar field1 type="string">,
    <dtml-sqlvar field2 type="string">,
    <dtml-sqlvar field3 type="string">)
2. "call_insertNew" is a python script that is called as an "After
Validation Script" by a pfg form

request = container.REQUEST
form = request.form

changed_field1 = form.get('field1')
changed_field1 = "a new computed value"
field1 = changed_field1

#create a new record with form field results for field2 & field3, and a
computed value for field1

It's easy to insert and update Z SQL Methods directly from form field

It's easy to read form field results (e.g. request.field2) and do
comparisons, etc.

I am struggling to understand how one can change a form field result with a
computed value from a python script.

Either of the following returns an error:
form.get('field1') = changed_field1
request.field1 = changed_field1

field1 = changed_field1
...the value doesn't get posted to the pgsql record.  Instead the pgsql
field1 value remains what the request.field1 value was originally.

Any direction is appreciated... Jim

View this message in context:
Sent from the Zope - DB mailing list archive at

Zope-DB mailing list

Reply via email to