[Zope] Passing Dictionary (ZPublisher.HTTPRequest.record)
Ronald L Roeber
rroeber1@unl.edu
Mon, 18 Mar 2002 16:13:12 -0600
Thank you Dieter,
You were correct. I had used 'records' instead of 'record' in the input
tag. I made the change and all works as advertized. That I got an object
that looked close to what I was looking for kept me from seeing the
obvious. Many thanks. Sorry for the trouble.
Dieter Maurer
<dieter@handsh To: rroeber1@unl.edu (Ronald L Roeber)
ake.de> cc: zope@zope.org
Subject: Re: [Zope] Passing Dictionary
03/18/2002 (ZPublisher.HTTPRequest.record)
11:54 AM
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