[Zope] #with tag problems

Amos Latteier amos@aracnet.com
Mon, 05 Apr 1999 11:03:31 -0700


At 03:35 AM 4/4/99 -0400, Christopher Petrilli wrote:
>OK, here's the DTML:
>
><!--#var standard_html_header-->
>
><!--#with "_[movie]"-->
>  <H3><!--#var title--></H3>
>
>  <P>
>  <B>Seen</B>: <!--#var review_date--> @ <!--#var theatre-->
>  </P>
><!--#/with-->
>
><!--#var "_[movie]" fmt="structured-text"-->
>
><!--#var standard_html_footer-->
>
>The problem is this... I'm passing this an object id as a GET variable
>(showFoo?movie=bar), and it's not working correctly to grab the title of
>the document ID I'm handing it.  movie = DTML document, it has all those
>properties (title, review_date, theatre), but theydon't want to show...
>I get attribute errors.  If I take out all but <!--#var title--> I get
>the title of the enclosing folder, not the movie document.  THis works
>just fine in another DTML method that looks idental to this one.

It looks like you want with to use an object named by the variable movie.
"_[movie]" calls the object named by the variable movie. You probably want
"_.getitem(movie)" which returns the object named by the variable movie
without rendering it.

-Amos

PS. Whenever you see Zope complaining that a string doesn't have an
attribute there's a good chance that you're using a rendered object, that
is to say, a string, rather than the object itself.