From: Dieter Maurer
Fernando Martins wrote at 2003-3-6 01:32 +0100:
I've two forms who pass a similar record to their scripts. Each script does its own processing, "normalising" the record. The record is then passed to another script which does common processing and final storage in a table.
You can pass dictionaries instead of records.
Yes, but I just needed to modify a maximum of two fields and in a set of 12. It would result in ugly and inefficient code. hmm, unless there's some way to automatically convert an object to a dictionary? (like a list comprehension or dict()) For the record, the obvious solution is to take these two away from this particular record, but a general solution would be better.
An alternative:
"Products.PythonScripts.standard" defines the record factory "Object" (maybe different case, check the source).
It returns a writable "record".
I tried this script: import Products.PythonScripts.standard ObjFields = Products.PythonScripts.standard.Object() ObjFields = Fields ObjFields.a_field = 10 and I got the same error:
Error Type: TypeError Error Value: attribute-less object (assign or del)
Can you spot what's wrong? Thanks, Fernando