[Zope] DTML Question Continued

beno zope@thewebsons.com
Wed, 15 Jan 2003 04:26:11 -0400


This is becoming far_more_complex than I anticipated. I would love to be 
able to do something like this:

<dtml-let lang="REQUEST.get('HTTP_ACCEPT_LANGUAGE','en-us')">
  <dtml-in objectValues>
   <dtml-let folder=id>
    <dtml-let langShort=lang[2:]>
     <dtml-var langShort>
     <dtml-if expr="folder==lang">
      <dtml-var lang>
     </dtml-if>
    </dtml-let>
   </dtml-let>
  </dtml-in>
</dtml-let>

but there are two problems here:
1) Apparently I can't slice in DTML;
2) The expression "folder==lang" evaluates the literal strings, not the 
variables.

The second problem is probably far less difficult than the first. The first 
seems to necessitate I do this as a Python script. That being the case, it 
seems logical to do the objectValues iteration in the same script. So, how 
do I do that? Looking at Appendix B, I find *propertyIds()* as a likely 
method. What would my syntax be? Something like this?

for property in propertyIds():

or do I need *context.propertyIds()*?
TIA,
beno