RE: [Zope] ZCatalog and dates

2000-11-28 Thread James Sintz

They are a date type.

The date index or goLiveDate index is now a keyword index instead of a text
index. However, when I try to find items of the meta_type "news" to catalog
I get an AttributeError with an error value of  __getitem__

!--
Traceback (innermost last):
  File /usr/local/Zope222/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /usr/local/Zope222/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/local/Zope222/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /usr/local/Zope222/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/local/Zope222/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: manage_catalogFoundItems)
  File /usr/local/Zope222/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: manage_catalogFoundItems)
  File /usr/local/Zope222/lib/python/Products/ZCatalog/ZCatalog.py, line
335, in manage_catalogFoundItems
(Object: Traversable)
  File /usr/local/Zope222/lib/python/Products/ZCatalog/ZCatalog.py, line
584, in ZopeFindAndApply
(Object: Traversable)
  File /usr/local/Zope222/lib/python/Products/ZCatalog/ZCatalog.py, line
572, in ZopeFindAndApply
(Object: Traversable)
  File /usr/local/Zope222/lib/python/Products/ZCatalog/ZCatalog.py, line
377, in catalog_object
(Object: Traversable)
  File /usr/local/Zope222/lib/python/Products/ZCatalog/Catalog.py, line 379,
in catalogObject
  File /usr/local/Zope222/lib/python/SearchIndex/UnKeywordIndex.py, line 32,
in index_object
  File /usr/local/Zope222/lib/python/DateTime/DateTime.py, line 1096, in
__getattr__
AttributeError: (see above)

--

What am I doning wrong??

Jamey

 -Original Message-
 From: Andy McKay [SMTP:[EMAIL PROTECTED]]
 Sent: Tuesday, November 28, 2000 3:10 PM
 To:   James Sintz; [EMAIL PROTECTED]
 Subject:  Re: [Zope] ZCatalog and dates
 
 Are your dates actually of type date or string? If they are dates make
 sure
 your date index is a keyword index and that the input is also of type
 date.
 --
   Andy McKay, Developer.
   ActiveState.
 
 - Original Message -
 From: "James Sintz" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, November 28, 2000 11:37 AM
 Subject: [Zope] ZCatalog and dates
 
 
 
  I have a ZCatalog set up to index a date field and a title field.
 
  When I do a search for meta_type "news" I get a tabular list back of all
 18
  cataloged items showing, among other things the date field (goLiveDate)
 and
  the title field.
 
  If I do a search for both meta_type of "news" a date of 2000/11/16 in
 the
  goLiveDate field the results page returns "There was no data matching
 this
  Catalog query". Yet when I do a search for the meta_type of "news" alone
 I
  see that indeed the Catalog contains 2 entries with 2000/11/16 in the
  goLiveDate field.
 
  Why doesn't it find any entries when I search by date?
 
 
  Jamey
 
 
 
 
 
 
 
 
 
 
 
  ___
  Zope maillist  -  [EMAIL PROTECTED]
  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 )
 

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] ZCatalog and dates

2000-11-28 Thread Uros Midic

 If I do a search for both meta_type of "news" a date of 2000/11/16 in the
 goLiveDate field the results page returns "There was no data matching this
 Catalog query". Yet when I do a search for the meta_type of "news" alone I
 see that indeed the Catalog contains 2 entries with 2000/11/16 in the
 goLiveDate field.

 Why doesn't it find any entries when I search by date?

If goLiveDate is of DateTime type and is being indexed as a field index, try
using a range, for instance:

dtml-in "Catalog( { 'meta_type' : 'news',
'goLiveDate' : [ someDate , someDate + 1 ],
'goLiveDate_usage' : 'range:min:max' } )"

/dtml-in

 someDate is _.DateTime('2000/11/16 00:00') or something like that.

p.s. It's very hard to catch a particular moment in the time continuum, but
it is easier with a time interval. :-)



___
Zope maillist  -  [EMAIL PROTECTED]
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 )