Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Maciej Wisniowski
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=field1)

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread onsombal
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) for

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Charlie Clark
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()

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Charlie Clark
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,

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread Maciej Wisniowski
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

Re: [Zope-DB] updating fields in a zsql method programmatically

2007-08-27 Thread onsombal
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