[Zope-CMF] Portal Catalog Date Matching

Walker, Byl BWalker@ProspectAssoc.com
Thu, 17 Jan 2002 11:13:09 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C19F71.DABE7400
Content-Type: text/plain

Thanks Tres!

For some reason, it worked on Manager accounts, but with Member accounts, it
displayed all of the objects.  I must have something else configured funky.

I figured a workaround, but it's very, very inefficient.  I just used an if
statement to match the current day:

<dtml-if expr="effective_date.isCurrentDay()">

As I said, very inefficient, but it works in all instances.

Thanks again, though, for the help!

Byl

-----Original Message-----
From: Tres Seaver [mailto:tseaver@zope.com] 
Sent: Thursday, January 17, 2002 10:50 AM
To: Walker, Byl
Cc: 'zope-cmf@zope.org'
Subject: Re: [Zope-CMF] Portal Catalog Date Matching

Walker, Byl wrote:

> Howdy all --
> 
>  
> 
> I'm trying to pull portal content based on the effective date of an item 
> matching the current date.  This is my search call:
> 
>  
> 
>  
> 
> <dtml-in "portal_catalog.searchResults(meta_type='CMF Quotes',
>                             review_state ='published',
>                             sort_on = 'Date',
>                             sort_order = 'reverse',
>                             effective_date =
'effective_date.isCurrentDay()'

                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
should be:
                               effective=( ZopeTime().earliestTime()
                                         , ZopeTime().latestTime()
                                         ),
                               effective_usage="range:min:max"

>                             )">
> 
> Since I am asking this question, you will all know that this isn't 
> working.  Any idea what I should be putting on the other side of 
> "effective_date = "?


Or something to that effect (I would actually put this in a
PythonScript, and have the DTML call the script to get the
results back).

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com

------_=_NextPart_001_01C19F71.DABE7400
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Zope-CMF] Portal Catalog Date Matching</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Thanks Tres!</FONT>
</P>

<P><FONT SIZE=3D2>For some reason, it worked on Manager accounts, but =
with Member accounts, it displayed all of the objects.&nbsp; I must =
have something else configured funky.</FONT></P>

<P><FONT SIZE=3D2>I figured a workaround, but it's very, very =
inefficient.&nbsp; I just used an if statement to match the current =
day:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;dtml-if =
expr=3D&quot;effective_date.isCurrentDay()&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>As I said, very inefficient, but it works in all =
instances.</FONT>
</P>

<P><FONT SIZE=3D2>Thanks again, though, for the help!</FONT>
</P>

<P><FONT SIZE=3D2>Byl</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Tres Seaver [<A =
HREF=3D"mailto:tseaver@zope.com">mailto:tseaver@zope.com</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, January 17, 2002 10:50 AM</FONT>
<BR><FONT SIZE=3D2>To: Walker, Byl</FONT>
<BR><FONT SIZE=3D2>Cc: 'zope-cmf@zope.org'</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Zope-CMF] Portal Catalog Date =
Matching</FONT>
</P>

<P><FONT SIZE=3D2>Walker, Byl wrote:</FONT>
</P>

<P><FONT SIZE=3D2>&gt; Howdy all --</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; I'm trying to pull portal content based on the =
effective date of an item </FONT>
<BR><FONT SIZE=3D2>&gt; matching the current date.&nbsp; This is my =
search call:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; &lt;dtml-in =
&quot;portal_catalog.searchResults(meta_type=3D'CMF Quotes',</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; review_state =
=3D'published',</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sort_on =3D 'Date',</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sort_order =3D 'reverse',</FONT>
<BR><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; effective_date =3D =
'effective_date.isCurrentDay()'</FONT>
</P>

<P><FONT =
SIZE=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&nbsp;&nbsp;&nbsp; ),</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
effective_usage=3D&quot;range:min:max&quot;</FONT>
</P>

<P><FONT =
SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Since I am asking this question, you will all =
know that this isn't </FONT>
<BR><FONT SIZE=3D2>&gt; working.&nbsp; Any idea what I should be =
putting on the other side of </FONT>
<BR><FONT SIZE=3D2>&gt; &quot;effective_date =3D &quot;?</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Or something to that effect (I would actually put =
this in a</FONT>
<BR><FONT SIZE=3D2>PythonScript, and have the DTML call the script to =
get the</FONT>
<BR><FONT SIZE=3D2>results back).</FONT>
</P>

<P><FONT SIZE=3D2>Tres.</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT =
SIZE=3D2>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D</FONT>
<BR><FONT SIZE=3D2>Tres =
Seaver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
tseaver@zope.com</FONT>
<BR><FONT SIZE=3D2>Zope Corporation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
&quot;Zope Dealers&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A =
HREF=3D"http://www.zope.com" =
TARGET=3D"_blank">http://www.zope.com</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C19F71.DABE7400--