[Zope] url question...

Peter Bengtsson peter@grenna.net
Sun, 25 Mar 2001 02:58:34 +0100


You've got the string calling wrong. String.split() is a "builtin" =
python module for DTML. You call it by _.string.split()

Besides...
python syntax: '/'[-1] =3D=3D '/'[0] =3D=3D '/' =3D=3D /

Besides you haven't declare string as builtin with the _.
<dtml-call "REQUEST.set('url_as_list',_.string.split(URL,'/'))">
Last objectid in URL: <dtml-var "url_as_list[-1]">

Or simpler:
<dtml-var expr=3D"_.string.split(URL,'/')[-1]">

----- Original Message -----=20
From: "Junk" <junk@gargl.net>
To: "Peter Bengtsson" <peter@grenna.net>
Sent: Friday, March 23, 2001 6:57 PM
Subject: RE: [Zope] url question...


> > string.split(URL,'/')[-1]
>=20
> why can't i do <dtml-var expr=3D"string.split(URL,'/'[-1])"> ???
>=20
> junk
>=20