Commit 832f6440 authored by Bartek Górny's avatar Bartek Górny

use creation and modification date in advanced search

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9248 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fc0f03be
...@@ -68,9 +68,31 @@ ...@@ -68,9 +68,31 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>kw.update(context.parseSearchString(kw.get(\'SearchableText\',\'\')))\n <value> <string encoding="cdata"><![CDATA[
kw.update(context.parseSearchString(kw.get(\'SearchableText\',\'\')))\n
\n
cf=kw.get(\'creation_from\')\n
ct=kw.get(\'creation_to\')\n
mf=kw.get(\'modification_from\')\n
mt=kw.get(\'modification_to\')\n
\n
wheres=[]\n
if cf:\n
wheres.append(\'creation_date>"\'+str(cf)+\'"\')\n
if ct:\n
wheres.append(\'creation_date<"\'+str(ct)+\'"\')\n
if mf:\n
wheres.append(\'modification_date>"\'+str(mf)+\'"\')\n
if mt:\n
wheres.append(\'modification_date<"\'+str(mt)+\'"\')\n
if wheres!=[]:\n
kw[\'where_expression\']=\' AND \'.join(wheres)\n
context.log(\'wheres\',kw[\'where_expression\'])\n
return context.portal_catalog(**kw)\n return context.portal_catalog(**kw)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -115,6 +137,14 @@ return context.portal_catalog(**kw)\n ...@@ -115,6 +137,14 @@ return context.portal_catalog(**kw)\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>cf</string>
<string>ct</string>
<string>mf</string>
<string>mt</string>
<string>wheres</string>
<string>str</string>
<string>_write_</string>
<string>_getitem_</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
......
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
<value> <value>
<list> <list>
<string>left</string> <string>left</string>
<string>right</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -78,6 +79,17 @@ ...@@ -78,6 +79,17 @@
</list> </list>
</value> </value>
</item> </item>
<item>
<key> <string>right</string> </key>
<value>
<list>
<string>creation_from</string>
<string>creation_to</string>
<string>modification_from</string>
<string>modification_to</string>
</list>
</value>
</item>
</dictionary> </dictionary>
</value> </value>
</item> </item>
......
86 88
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment