Re: updating fields in a zsql method programmatically

Maciej Wisniowski <[email protected]> Mon, 27 Aug 2007 18:27:07 +0200
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
> 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)

or even:

context.insertNew(field1='something', field2=other_variable)

It is more clear than getting values from context I think.

-- 
Maciej Wisniowski