Commit 1c704f07 authored by Fabien Morin's avatar Fabien Morin

Now subject is well catalogued. Use only catalog to find blog post message

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40090 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5a9a3953
...@@ -54,26 +54,9 @@ ...@@ -54,26 +54,9 @@
This script returns the blog post that must be displayed in the current section.\n This script returns the blog post that must be displayed in the current section.\n
The blog post are filtered through the subject parameter that is retrieved through\n The blog post are filtered through the subject parameter that is retrieved through\n
the GET parameters.\n the GET parameters.\n
\n
TODO: XXX-JPS\n
- again, way too slow if this returns 1,000,000 documents\n
- appropriate way is to either call context.getDocumentValueList(subject=subject, **kw)\n
or context.getDocumentValueList(subject=subject), depending on your goal\n
what about ordering ...\n
"""\n """\n
\n
request = container.REQUEST\n
\n
current_section = context.getWebSectionValue()\n current_section = context.getWebSectionValue()\n
result = current_section.WebSection_getDocumentValueList(**kw)\n return current_section.WebSection_getDocumentValueList(subject=subject, **kw)\n
result_with_subject = []\n
if subject is not None:\n
for item in result: # XXX-JPS this could be way too slow\n
if subject in item.getSubjectList():\n
result_with_subject.append(item)\n
return result_with_subject\n
\n
return result\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -84,7 +67,7 @@ return result\n ...@@ -84,7 +67,7 @@ return result\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>subject=None, **kw</string> </value> <value> <string>subject=\'\', **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -113,16 +96,9 @@ return result\n ...@@ -113,16 +96,9 @@ return result\n
<string>subject</string> <string>subject</string>
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>container</string>
<string>request</string>
<string>context</string> <string>context</string>
<string>current_section</string> <string>current_section</string>
<string>_apply_</string> <string>_apply_</string>
<string>result</string>
<string>result_with_subject</string>
<string>None</string>
<string>_getiter_</string>
<string>item</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -135,7 +111,7 @@ return result\n ...@@ -135,7 +111,7 @@ return result\n
<key> <string>func_defaults</string> </key> <key> <string>func_defaults</string> </key>
<value> <value>
<tuple> <tuple>
<none/> <string></string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
76 78
\ 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