[Zope] Problem with calling methods

Paavo Parkkinen pparkkin@verso.st.jyu.fi
Thu, 12 Jun 2003 12:33:17 +0300


On to, 12.06.2003 at 11:03 +0200, Nikel, Ernst-Dieter wrote:

> I have the following problem:
>=20
> For example consider the code:
>=20
> <dtml-in "test.ba.objectValues()">
>   <dtml-var id>
> </dtml-in>
>=20
> This gives the ids in the folder test/ba.
>=20
> My problem is that in my applcation I get the path like "test/ba" in th=
e
> example through a REQUEST. The script=20
>=20
> <dtml-in "_[tt].ba.objectValues()">
>   <dtml-var id>
> </dtml-in>
>=20
> works if the variable "tt" contains the value "test". But I don't have =
found
> a possibility to call the method if the given path (or better the relev=
ant
> part of the path) contains more than one folder.
>=20
> The code  =20
>=20
> <dtml-in "_[tt].objectValues()">
>   <dtml-var id>
> </dtml-in>
>=20
> don't works if the variable "tt" contains "test.ba".

I don't know dtml, but you can probably translate this python
code to dtml:

  for k in container.REQUEST.resolve_url(tt).objectValues():
    print k.getId()

If you have the full url, you can use request.resolve_url() to get the
object, and call objectValues() on that.

--=20
paavo.

 "joskus voi t=E4=E4 meno k=E4yd=E4 ahdistavaksi
  kun on t=E4=E4ll=E4 muodostunut tavaksi
  muuttaa jokaisen el=E4m=E4n arvo rahaksi"