[Zope-dev] Test to see if an item is a list
Jason Spisak
444@hiretechs.com
Wed, 01 Mar 2000 18:47:52 GMT
Actually with the purpose I have in mind, I have to use the klunky notation
because I am nesting sequences. I new there was a reason that I passed
over that simple explanation.
BTW to test for a list I used try/except in DTML one line
<dtml-try "REQUEST.form.values()[a][2]">
or in your other case
<dtml-try "_['sequence-item'][2]">
If it can slice then it's a list or dictionary, and since DTML properties
can only store strings, integers, flots, text and lists (tokens/lines),
then that works for passing previous inputs from forms.
All my best,
Sam Gendler writes:
> Jason. I am very interested in the answer to this, but I don't have the
> bandwidth to read the list right now. Could you forward any response to
> my address, please? Thanks.
> By the way, I was able to do the following, to simplify your previous
> problem.
>
> <dtml-in "REQUEST.form.items()">
> <dtml-var sequence-key> is the name
> <dtml-var sequence-item> is the value
> </dtml-in>
>
> --sam
>
> Jason Spisak wrote:
> >
> > Zopists,
> >
> > Does anyone know a test to see is an item is a list?
> > <dtml-if "REQUEST.form.keys()[a] is list">
> >
> > All my best,
> >
> > --
> > Jason Spisak
> > 444@hiretechs.com
> >
> > _______________________________________________
> > Zope-Dev maillist - Zope-Dev@zope.org
> > http://lists.zope.org/mailman/listinfo/zope-dev
> > ** No cross posts or HTML encoding! **
> > (Related lists -
> > http://lists.zope.org/mailman/listinfo/zope-announce
> > http://lists.zope.org/mailman/listinfo/zope )
>
> --
> --------------------------
> Sam Gendler
> CTO, Impossible, Inc.
> 1222 State St. Suite 250
> Santa Barbara, CA. 93101
> p: 805-560-0508
> f: 805-560-0608
> c: 805-689-1191
> e: sgendler@impossible.com
Jason Spisak
CIO
HireTechs.com
6151 West Century Boulevard
Suite 900
Los Angeles, CA 90045
P. 310.665.3444
F. 310.665.3544
Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
address may not be added to any commercial mail list with out my
permission. Violation of my privacy with advertising or SPAM will
result in a suit for a MINIMUM of $500 damages/incident, $1500 for
repeats.