[Zope-CMF] Re: Effective Date inconsistencies
Alexander Limi
limi at plone.org
Sat Jun 23 06:07:59 EDT 2007
On Sat, 23 Jun 2007 02:55:51 -0700, Charlie Clark
<charlie at begeistert.org> wrote:
> What would you rather have? An attribute error?
No, I want a boolean false value.
If you wish to compare the values you need to
> access context.effective and context_modified
>
> <tal:test tal:condition="python: context.effective() <
> context.modified()" />
I already stated that this won't work, it returns __FLOOR_DATE, which
makes it useless for boolean operations:
def effective( self ):
""" Dublin Core Date element - date resource becomes effective.
"""
marker = []
date = getattr( self, 'effective_date', marker )
if date is marker:
date = getattr( self, 'creation_date', None )
return date is None and self.__FLOOR_DATE or date
I'd like this one to return False, not some floor value. I understand that
the official CamelCase accessors always return strings (which is fine),
but I don't see why "effective()" can't give a False value. Is this just
historical, or is there a real reason for it?
--
Alexander Limi · http://limi.net
More information about the Zope-CMF
mailing list