Dne pondělí 06 srpen 2001 16:12 jste napsal(a):
Milos Prudek wrote:
Struggling with the ":records" form construct...
[snip]
But how can I change the value? I tried this inside Python Script:
You can enable writing of record attributes by adding this line to the "record" class in $ZOPE/lib/python/ZPublisher/HTTPRequest.py:
_guarded_writes = 1
(make sure it's indented the same as the body of the class).
An easy patch... but I rather do not patch at all... I may be forced to work with unpatched Zope release. I think I'll convert :records to a list of tuples... IMHO :records usefulness is quite limited because it is not mutable and because it hinders iteration over <dtml-in>dtml-call APythonScript></dtml-in> unless you pass it as a parameter. But I am very inexperienced Zoper. AFAIK :records are useful in the web form itself to gather data.. and you can feed :records into ZSQL directly for data rows insertion... and that's about it. If you need more, you should convert :records into some standard Python data structure that you can flexibly work with. Please correct me if I'm wrong. -- Milos Prudek