[Zope] Passing Dictionary

Dieter Maurer dieter@handshake.de
Fri, 15 Mar 2002 20:59:00 +0100


Ronald L Roeber writes:
 > ... <input name="feed.calc_method:records" ...> ....
 > What shows up in the REQUEST object is this:
 > 
 > feed = [calc_method: 'ration_cost', fed_per_day: 6.0, feed_cost_ton: 66.0]
 > 
 > This is not a dictionary (len(feed)=1) it looks like a one element list
 > (that looks like it was or is trying to be a dictionary). Using Zope 2.5.0.
It's a "ZPublisher.HTTPRequest.record" instance, not a dictionay.

Such record instances behave like mappings (have "get", "keys",
"items", "values", "copy" and "has_key" methods) and support
both subscription and attribute access.

You can get a standard dictionary from a record instance "r"
by "r.copy()".


Dieter