RE: ZCatalog: searching by date
At 10:23 AM 11/23/99 -0500, Michel Pelletier wrote:
Your search form does not have have a bobobase_modification_time_usage hidden field. This tells ZCatalog you want to do a range search.
OK. Yes, it was in the original post, but it got accidently deleted in the last post. Unfortunately that still didn't solve our problem. We are still getting No data found. I have done a little more debugging and I think I am missing a step here: if I fill in the raw field and set date to EVER, than it returns no results. But if I edit the URL and remove the strings after bobobase_modification_time_usage= , and bobobase_modification_time= then the search returns whatever matches the raw correctly. After reading through the Advanced ZCatalog Searching, I am now wondering if the problem is casting, although after reading the document I am still not clear on the syntax of casting in Zope. More information: Our ZCatalog is setup exactly like the first ("raw") example in the Z Catalog Tutorial. And the latest iteration of "search_form" is below. any help in this area would be appreciated... thanks, sachin shah <!--#var standard_html_header--> <form action="report" method="get"> <h2><!--#var document_title--></h2> Enter query parameters:<br><table> <tr><th>Search for text:</th> <td><input name="raw" width=30 value=""></td></tr> <tr><th>Modified since: </th> <td><input type=hidden name="bobobase_modification_time_usage" value="range:min"> <select name="bobobase_modification_time"> <option value="<!--#var "ZopeTime(0)" -->">Ever</option> <option value="<!--#var "ZopeTime() - 1" -->">Yesterday</option> <option value="<!--#var "ZopeTime() - 7" -->">Last Week</option> <option value="<!--#var "ZopeTime() - 30" -->">Last Month</option> <option value="<!--#var "ZopeTime() - 365" -->">Last Year</option> </select></td></tr> <tr><td colspan=2 align=center> <input type="SUBMIT" name="SUBMIT" value="Submit Query"> </td></tr> </table> </form> <!--#var standard_html_footer-->
On Tue, 23 Nov 1999, Sachin Shah wrote:
After reading through the Advanced ZCatalog Searching, I am now wondering if the problem is casting, although after reading the document I am still not clear on the syntax of casting in Zope.
<select name="bobobase_modification_time">
Try changing this to: <select name="bobobase_modification_time:date"> This will tell Zope cast the value into a date time (so REQUEST.bobobase_modification_time will be a Date time instead of a string). Also, make sure that when you are doing your search, you are referencing REQUEST.bobobase_modification_time rather than just bobobase_modification_time (or else the bobobase_modification_time attribute of request.dtml will be aquired instead of the value set in REQUEST). Or call your date parameter something different that doesn't conflict. -- ___ // Zen (alias Stuart Bishop) Work: zen@cs.rmit.edu.au // E N Senior Systems Alchemist Play: zen@shangri-la.dropbear.id.au //__ Computer Science, RMIT WWW: http://www.cs.rmit.edu.au/~zen
participants (2)
-
Sachin Shah -
Stuart 'Zen' Bishop