[Zope-CMF] list -> string -> list
Bryan C. Andregg
bryan.andregg@duke.edu
Mon, 12 Aug 2002 14:42:54 -0400
--9IxM5hJjweoYfefN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
I have a form on which I am doing some verification and if the verification
fails returns the same form with fields already filled in where possibe usi=
ng
REQUEST. One road block that I've run into is a set of checkboxes that I ha=
ve.
My verification script can deal correctly with them regardless whether or n=
ot
it's sent a list, and string, or nothing it all. In passing back to the
calling form I thought I'd do something like use url_quote to pass REQUEST
something like:
myForm?list=3D%5B%27checkbox_1%27%2C%20%27checkbox_2%27%5D
which is equivalent to ['checkbox_1', 'checkbox_2']
And then use something like
tal:condition=3D"python: 'checkbox_1' in request['list']"
as a test.
This generates a guarded_getitem error, however request['list'] does exist =
and
is retrievable.
1. How can I test this condition?
2. Has anyone done this before in a different way?
cheers,
--=20
Bryan C. Andregg Duke University Medical Center
Programmer Dept. of Anesthesiology
e <bryan.andregg@duke.edu>
p +1 919 684 6201
--9IxM5hJjweoYfefN
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE9WAGuj9pElyS/cakRAlbmAJ9wjssLvgGwhBn4rieQsYeZap3NlACeOvRp
n2kbBfKcP0e1RNN1QTO51Hw=
=TfRR
-----END PGP SIGNATURE-----
--9IxM5hJjweoYfefN--