-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Alexander Limi wrote: > On Sun, 24 Jun 2007 06:33:28 -0700, Tres Seaver > <[EMAIL PROTECTED]> 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. - -- =================================================================== Tres Seaver +1 540-429-0999 [EMAIL PROTECTED] Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGfxPB+gerLs4ltQ4RAuJxAKDLEfuX795V/XkFA53dF15DdTlbYQCgsb0Z /6MI3nhHOju5n5IEt1qqFW4= =DUlN -----END PGP SIGNATURE----- _______________________________________________ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests