[Zope-CMF] Re: Effective Date inconsistencies

Tres Seaver tseaver at palladion.com
Sun Jun 24 09:33:28 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Limi wrote:
> On Sat, 23 Jun 2007 08:15:02 -0700, Wichert Akkerman  
> <wichert at wiggy.net> wrote:
> 
>> Previously Laurence Rowe wrote:
>>> How about changing EffectiveDate to:
>>>
>>>         return ed and ed.toZone(zone).ISO() or ''
>>>
>>> from the existing (as pointed out by Charlie):
>>>
>>>         return ed and ed.toZone(zone).ISO() or 'None'
>>>
>>> It would seem the least risky fix. (I'm not sure it's strictly a bug but
>>> it struck me as completely brain dead when I was caught out by it).
>> We can't change it - people may rely on the current behaviour.
> 
> Which I why I ask here, people that may rely on this are likely to be on  
> this list (and able to speak up about it).
> 
> The fact that zope.dublincore got it right makes it even more interesting  
> to harmonize them, IMO.

- -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.


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).



Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
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

iD8DBQFGfnKo+gerLs4ltQ4RAjO6AJ4yfm3QtBXo8S5/sEVUZiN2xn3C9ACggKnx
/UfEs/SLTHm8UcqH2iEuIQ0=
=7XO4
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list