[Zope] DateTime and ZCatalog

Vladimir Petrovic vladap@epi.yu
Tue, 4 Apr 2000 20:18:07 +0200


There is one strange thing with dates and ZCatalog:

I have a ZClass which inherits CatalogAware. It has one date property
called cdate in propertysheet data. Property cdate is set in the _addForm.
Method _add looks like this:

<dtml-with "TestDate_Class.createInObjectManager(REQUEST['id'], REQUEST)">
    <dtml-call "propertysheets.data.manage_editProperties(REQUEST)">
    <dtml-call "reindex_object">
</dtml-with>

...

Now, I have a folder which contains Catalog and has cdate as field index.
Method index_html first displays  objects that have cdate newer then current
time and then displays older. index_html:

<dtml-var standard_html_header>
<dtml-call "REQUEST.set ('cur_date', ZopeTime ())">

<p>New:<br><br><ul>
<dtml-in "Catalog (cdate=cur_date, cdate_usage='range:min')">
    <li><dtml-var id></li>
</dtml-in></ul>

<p><hr>Old:<br><br><ul>
<dtml-in "Catalog (cdate=cur_date, cdate_usage='range:max')">
    <li><dtml-var id></li>
</dtml-in></ul>
<dtml-var standard_html_footer>


When I create ZClass objects they are always first shown in Old list even if
they have future cdate. I need to update Catalog to get correct New list !