So, my script now works!! Thanks to everyone for your input. It is greatly
appreciated. Below is a quick summary of what I did and a relevant excerpt
of the working script.
1) I never was able to get passing the arguments via the context.Statement
to work. I'm sure it's something I've done wr
onsombal napisaĆ(a):
> I tried the techniques you suggested and it results in the same error -->
> "KeyError: 'form.submitted'"
You didn't tell about this kind of error before.
Post a full traceback, please.
I suppose that error is somewhere else...
--
Maciej Wisniowski
__
onsombal wrote at 2007-8-27 06:59 -0700:
> ...
> ...
>It's easy to insert and update Z SQL Methods directly from form field
>results.
>
>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 wit
Am 27.08.2007, 21:59 Uhr, schrieb onsombal <[EMAIL PROTECTED]>:
I'm assuming the form results are stored as an object represented as a
dictionary. If so, then there must be a way for my python script to
change
the key | value pair for field1 before I call my Z SQL Method. Is this
reasonable
Am 27.08.2007, 15:59 Uhr, schrieb onsombal <[EMAIL PROTECTED]>:
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
context.insertNew()
^
I tried the techniques you suggested and it results in the same error -->
"KeyError: 'form.submitted'"
field1 = changed_field1
context.insertNew(field1=field1) --> I also tried the other technique and
got the same error.
I tried your technique with the following changes to my pfg (ploneformgen)
> 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
> context.insertNew()
Obvious things are sometimes hardest to find ;)
Try:
field1 = changed_field1
context.insertNew(field1=
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)
VALUES (
,
,
)
2. "call_insertNew" is a python script that is called as an "After
Validati