Hi all, I'm learning python. If I do: class Foo: pass bar = Foo() bar.baz = 1 in order to create a record I get an "attribute-less object" error from zope, but it works right on the python interpreter. Is there a way to create records (the same type of record I get from forms with :record) from a python script? TIA Regards -- //// (@ @) ---------------------------oOO----(_)----OOo------------------------ Los pecados de los tres mundos desapareceran conmigo. Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain) --------------------------------------------------------------------
Alexis Roda wrote:
Is there a way to create records (the same type of record I get from forms with :record) from a python script?
In 2.6 and above you can do: from Products.PythonScripts.standard import Object bar = Object() bar.baz = 1 These are actually a subclass of 'record' that allows item assignment as well. Cheers, Evan @ 4-am
participants (2)
-
Alexis Roda -
Evan Simpson