On 4 Aug 2000, at 22:10, Dieter Maurer wrote:

> Brad Clements writes:
>  > However first-eventday is ALWAYS true, however when I print &dtml-
>  > eventday; the output value is always the same for each row, so first-
>  > >
>  eventday shouldn't be true on any row except the first.
> 
> Almost surely, the "in" tag does not call a callable object
> (because it does not expect, they could be callable).
> You, therefore, get the method itself.
> It is identical for all records.


So true, the solution is to define an __init__ class in the brain class,
then use that to populate "self".

class   PackageEvent:
    """Package Event Pluggable Brain"""
    def __init__(self):
        """initialize"""
        self.__dict__['eday'] = self.eventday()

    def eventday(self):
        return
        DateTime(apply(time.mktime,self.eventtime.tuple()[:3]+(0,0,0,0,0,-1
        )))


Now 'first-eday' works.


Brad Clements,                [EMAIL PROTECTED]   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements

_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to