[Zope] range:min bug in ZCatalogs fo Zope 2.3.2
Andreas Jung
andreas@andreas-jung.com
Thu, 21 Mar 2002 06:08:47 -0500
Try to reproduce the same problem under 2.5.X.
Or upgrade to 2.5.X.
Andreas
----- Original Message -----
From: "Johan Carlsson [Torped]" <johanc@torped.se>
To: <zope@zope.org>; <zope-dev@zope.org>
Sent: Thursday, March 21, 2002 05:51
Subject: [Zope] range:min bug in ZCatalogs fo Zope 2.3.2
> Hi,
> I have encountered a strange problem with ZCatalogs in Zope 2.3.2.
>
> We have objects having DateTime arguments effective_date and
expiration_date
> that gets indexed in different ZCatalogs. (The index is a field index).
>
> We then tries to get all published objects that have not yet been
archived:
>
> now=_.DateTime()
> Service.searchResults(
> effective_date =now, effective_date_usage='range:max'
> , expiration_date =now, expiration_date_usage='range:min'
> )
>
>
> Now this works fine, until one day when result searchResults returns an
> empty result list
> which is not expected.
> It seems to be that some days the range:min statement doesn't work
correctly.
> (I tried with different range:* combinations and the only thing I found
not
> working
> is the range:min statement (some days).
>
> If I instead use a different value for now:
>
> now2 = _.DateTime(now.Date()) # now.Date() returns somethong like
> "2002/03/21" which in turn makes the now2 equal to the DateTime value
> "2002/03/21 00:00:000 GMT+1" (GMT+1 is my local TimeZone)
>
> Now using now2 in:
>
> Service.searchResults(
> effective_date =now, effective_date_usage='range:max'
> , expiration_date =now2, expiration_date_usage='range:min'
> )
>
> will always result in a list (all though it gets quantized to midnight the
> resulting list will be somewhat biased).
>
> What I don't seem to understand is that DateTime() and
> DateTime(DateTime().Date) gets so different results.
>
> Have anyone seen something like this before?
>
> Best Regards,
> Johan Carlsson
>
>
>
>
> --
> Johan Carlsson, Torped AB
>
> http://www.torped.se -- http://easypublisher.torped.se
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> 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 )
>