[Zope] Method reusability

Casey Duncan cduncan@kaivo.com
Mon, 09 Jul 2001 10:30:07 -0600


belen@netcom.no wrote:
> 
> Hi Casey,
> It does work. Thanks a lot. But now I have another problem of similar
> characteristics that I somehow forgot to mention. Is there a way of
> achieving the same thing by making the parameters  available using the
> let tag? This would allow me to also make the document to save generic
> and not hard coded.
> 
> <dtml-let allparam=allparam>  ( something similar to _)
> <dtml-var "_['potentialDocument']">
> </dtml-let>
> 
> Where potentialDocument can be any DTMLDocument I want to download. I
> would get its name by passing the "document_id" variable.
> 
> I have tried something like <dtml-var "_['potentialDocument'](_.None,
> _)">...But it is not working.
> 
> Thanks again...Hope not to be asking to much : - )
> 
> Belen
> 

Try using _.getitem('potentialDocument') in place of _[...]. _[...] will
call the object if it is callable, and return a string. _.getitem()
won't call anything by default.

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