[Zope] TypeError trying to use Dtml-in on Zclass

weboats@web-oats.com weboats@web-oats.com
Wed, 9 Aug 2000 14:54:25 -0700 (PDT)


Thank you Kapil,

Yes, the problem was I didn't understand the difference 
between dtml-in and dtml-with.  I wasn't trying to 
process a list.

<dtml-with States>
<dtml-var index_html>
</dtml-with>

Does what I wanted it to do.  Thanks again.

Kevin Smith

Quoting Kapil Thangavelu <kthangavelu@earthlink.net>:

> weboats@web-oats.com wrote:
> >
> > Hi All,
> >
> > I have a Zclass object called States
> > built with folder and renderable
> >
> > When I try
> >
> > <dtml-in States>
> > <dtml-var sequence-item>
> > </dtml-in>
> >
> > I get
> > Error Type: TypeError
> > Error Value: hasattr, argument 2: expected string, 
int
> > found
> >
> > Does anyone know why this is happening?
>
> educated guess:
>
> dtml-in processes lists. you can pass it in any 
pythonish expression
> that generates a list. your passing it in the object 
States which would
> be fine only if your render method generates a list. 
i'm thinking what
> you want is
>
> if you want is a specific method of States like 
individual states
>
> <dtml-in "States.get_all_states(_.None, _)">
> <dtml-var sequence-item>
> </dtml-in>
>
> Kapil
>