[Zope] Passing Dictionary (ZPublisher.HTTPRequest.record)

Dieter Maurer dieter@handshake.de
Mon, 18 Mar 2002 18:54:34 +0100


Ronald L Roeber writes:
 > ...
 > As per your suggestion. I get an Attribute Error from Zope every time I try
 > to get the ZPublisher.HTTPRequest.record instance to behave like mappings.
 > 
 > get, copy, items, values, has_key all generate attribute errors.
Strange. I can do that. Are you sure, you use a record instance?

I tested with the following form/action pair:

test_record_form:
	<dtml-var standard_html_header>
	<h2><dtml-var title_or_id> <dtml-var document_title></h2>
	<form action="test_record_action">
	<p>
	<input name="a.a:record" value="a" type="hidden">
	<input name="a.b:record" value="b" type="hidden">
	<input type=submit>
	</p>
	</form>
	<dtml-var standard_html_footer>

test_record_action:
	<dtml-var standard_html_header>
	<h2><dtml-var title_or_id> <dtml-var document_title></h2>
	<p>
	<dtml-var expr="a.items()">
	<dtml-var expr="a.copy()">
	</p>
	<dtml-var standard_html_footer>


I remember that your original post mentioned ":records" not ":record",
then your object is a sequence of "record" objects. You need to first
select a single record object (throuch subscription with integers,
e.g. "o[0]") and can then use the record methods and attributes.


Dieter