Platform information:

Zope version: Zope 2.2.1b1 (binary release, python 1.5.2,
Python version: 1.5.2 (#10, Dec 6 1999, 12:16:27) [GCC] 
System Platform: linux2 


Notice in add_weekly the <dtml-call day_list>.
It does nothing but with out it I get this traceback:

               Zope Error

               Zope has encountered an error while publishing
this resource. 

               Error Type: AttributeError
               Error Value: __getitem__

Traceback (innermost last):
  File /usr/local/zope/2.2/lib/python/ZPublisher/, line
222, in publish_module
  File /usr/local/zope/2.2/lib/python/ZPublisher/, line
187, in publish
  File /usr/local/zope/2.2/lib/python/Zope/, line 221,
in zpublisher_exception_hook
    (Object: Traversable)
  File /usr/local/zope/2.2/lib/python/ZPublisher/, line
171, in publish
  File /usr/local/zope/2.2/lib/python/ZPublisher/, line
160, in mapply
    (Object: add_weekly)
  File /usr/local/zope/2.2/lib/python/ZPublisher/, line
112, in call_object
    (Object: add_weekly)
  File /usr/local/zope/2.2/lib/python/OFS/, line
172, in __call__
    (Object: add_weekly)
line 502, in __call__
    (Object: add_weekly)
  File /usr/local/zope/2.2/lib/python/DocumentTemplate/,
line 691, in renderwob
    (Object: done_list)
/usr/local/zope/2.2/lib/python/DocumentTemplate/, line
337, in eval
    (Object: _['sequence-item'] in day_list)
    (Info: day_list)
  File <string>, line 0, in ?
AttributeError: (see above)

DTML METHOD: period_begin
Selects a set of dates in the past 41 days that are either the
first day of the month or a Sunday. Returns the list.

<dtml-call "REQUEST.set('first_day', ZopeTime() )">
<dtml-call "REQUEST.set('to_day', ZopeTime() )">
<dtml-call "REQUEST.set('day_list', [])">

  <dtml-in "_.range(0,40)">
    <dtml-call "REQUEST.set('rpt_date', first_day -

     <dtml-if "rpt_date.lessThanEqualTo( to_day )">
       <dtml-if "( or rpt_date.dow()==0">
          <dtml-call "day_list.append(rpt_date.strftime('%Y / %m
/ %d'))">


<dtml-return day_list>

DTML METHOD: add_weekly
Input form to report weekly activities. 

<dtml-call "REQUEST.set('day_list', period_begin)">
<dtml-call "REQUEST.set('done_list', [])">

<dtml-in "objectValues(['DTML Document'])">
  <dtml-if "doc_type == 'weekly'">
     <dtml-call "done_list.append(week_begin.strftime('%Y / %m /

<dtml-call day_list>

<dtml-in done_list>
   <dtml-if "_['sequence-item'] in day_list">
     <dtml-call "day_list.remove(_['sequence-item'])">

more code here that uses day_list in a <SELECT></SELECT> and
takes more form input.

Is this a bug or should I clean up my code??? <s>

-- Tim Cook --
FreePM Project Coordinator
OS Health Care Alliance Supporter

Zope maillist  -  [EMAIL PROTECTED]
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to