[Zope] sequence-item is a String? (was: Calling objects with arguments in asequence)sequence)

Chris McDonough chrism@digicool.com
Thu, 28 Sep 2000 06:50:52 -0400


> If you do:
>
> <dtml-in "objectValues('Foo Thing')">
> <dtml-let thing=sequence-item>
> <dtml-var "thing.id()">
> </dtml-let>
> </dtml-in>
>
> You get TypeError: it claims thing is a string, so you can't perform any
> kind of function call against it.

Some id attributes of Zope objects are methods, some are strings.

To account for every case:

  <dtml-in "objectValues('Foo Thing')">
    <dtml-let thing=sequence-item>
      <dtml-try>
        <dtml-var "thing.id()">
      <dtml-except TypeError>
        <dtml-var "thing.id">
      </dtml-try>
    </dtml-let>
  </dtml-in>

The need to do this will soon go away with the new "getId()" method mixed in
to all Zope objects.