[Zope] Converting a string into an object?

Casey Duncan cduncan@kaivo.com
Wed, 11 Jul 2001 11:31:20 -0600


Tommy Johnson wrote:
> 
[snip]
> 
> <dtml-with editable>
> 
>     <dtml-with expr="REQUEST.form['sectionId']">
>         <form action="Admin_action">
>         Title: <input name="title" size="20">
>         <br><br>
>         <textarea name="txtContent" cols="40" rows="7"
> wrap="virtual"></textarea>
>         <br><br>
> 
>         <input type="submit" name="submit" value=" Save Changes ">
>         </form>
>     </dtml-with>
> 
> </dtml-with>
> 

You can use indirection to lookup an object by id, or traversal via
restrictedTraverse to lookup via a path.

_.getitem(REQUEST.sectionId)

So change your with above to:

<dtml-with expr="_.getitem(REQUEST.sectionId)">

hth,
-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>