[Zope-CMF] Re: Effective Date inconsistencies

Tres Seaver tseaver at palladion.com
Sun Jun 24 21:00:49 EDT 2007

Hash: SHA1

Alexander Limi wrote:
> On Sun, 24 Jun 2007 06:33:28 -0700, Tres Seaver  
> <tseaver at palladion.com> wrote:
>> - -1:  anybody who is using the string representations for comparison is
>> mising the point:  those values are "display only."  they should be
>> using the forms which return real datetime obojects.
> Yeah, I wasn't arguing for changing the DC element accessors, I know those  
> should be strings.
>> The ceiling / floor date bits are there to support indexing / sorting,
>> and therefore comparison.
>> We could tackle this by adding an argument, 'use_ceiling' / 'use_floor'
>> to those methods, defaulting it to True for this release, and then
>> switch the default and add a deprecation warning in the next release.
>> Or we could add new APIs, e.g. 'effectiveOrNone', 'expiresOrNone' and
>> leave the current methods alone.
>> If you want to talk about remonving those  bits, you still have to deal
>> with special casing the bits where the content object has a real None
>> value.  For indexing, we can use the support provided already by
>> DateRangeIndex for handling "open" intervals (the real case that the
>> floor / ceiling were meant to handle).
> OK, I just wanted to compare two dates like I do in Python, and display a  
> result accordingly. So would the "correct" thing to do here make it  
> support None as a return value, but switch to DateRangeIndex?

You can't use the index to drive that sort of display;  you need to use
the "real" effective / expiration date, and handle the 'None' case
specially.  I would probably implement this as an adapter for
DefaultDublinCoreImpl (the class, not the interface) and use the
'effective_date' attribute directly,

- --
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Zope-CMF mailing list