[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. I must =
have something else configured funky.</FONT></P>
<P><FONT SIZE=3D2>I figured a workaround, but it's very, very =
inefficient. I just used an if statement to match the current =
day:</FONT>
</P>
<P><FONT SIZE=3D2><dtml-if =
expr=3D"effective_date.isCurrentDay()"></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>> Howdy all --</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> I'm trying to pull portal content based on the =
effective date of an item </FONT>
<BR><FONT SIZE=3D2>> matching the current date. This is my =
search call:</FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> <dtml-in =
"portal_catalog.searchResults(meta_type=3D'CMF Quotes',</FONT>
<BR><FONT =
SIZE=3D2>>  =
;  =
; review_state =
=3D'published',</FONT>
<BR><FONT =
SIZE=3D2>>  =
;  =
; sort_on =3D 'Date',</FONT>
<BR><FONT =
SIZE=3D2>>  =
;  =
; sort_order =3D 'reverse',</FONT>
<BR><FONT =
SIZE=3D2>>  =
;  =
; effective_date =3D =
'effective_date.isCurrentDay()'</FONT>
</P>
<P><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; =
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</FONT>
<BR><FONT SIZE=3D2>should be:</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; effective=3D( =
ZopeTime().earliestTime()</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; &nb=
sp; , ZopeTime().latestTime()</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; &nb=
sp; ),</FONT>
<BR><FONT =
SIZE=3D2> &nb=
sp; &nb=
sp; =
effective_usage=3D"range:min:max"</FONT>
</P>
<P><FONT =
SIZE=3D2>>  =
;  =
; )"></FONT>
<BR><FONT SIZE=3D2>> </FONT>
<BR><FONT SIZE=3D2>> Since I am asking this question, you will all =
know that this isn't </FONT>
<BR><FONT SIZE=3D2>> working. Any idea what I should be =
putting on the other side of </FONT>
<BR><FONT SIZE=3D2>> "effective_date =3D "?</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 =
=
=
tseaver@zope.com</FONT>
<BR><FONT SIZE=3D2>Zope Corporation =
"Zope Dealers" <A =
HREF=3D"http://www.zope.com" =
TARGET=3D"_blank">http://www.zope.com</A></FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01C19F71.DABE7400--