Commit c844be68 authored by Ivan Tyagov's avatar Ivan Tyagov

Make it possible to show not yet indexed threads using a relative url passed from REQUEST.

parent 5b852bb3
......@@ -160,7 +160,8 @@ if send_notification_text not in (\'\', None):\n
store_as_event=False)\n
\n
return context.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message),\n
thread_relative_url=discussion_thread.getRelativeUrl()))\n
</string> </value>
</item>
<item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""\n
This script gets list of Discussion Thread for a Forum using catalog. \n
Due to asynchronous nature of catalog it can use\n
passed from REQUEST not index yet threads.\n
"""\n
thread_relative_url = context.REQUEST.get(\'thread_relative_url\')\n
discussion_thread_list = [x.getObject() for x in context.getDocumentValueList(**kw)]\n
if thread_relative_url is not None:\n
thread = context.restrictedTraverse(thread_relative_url)\n
if thread is not None and thread not in discussion_thread_list:\n
discussion_thread_list = [thread] + discussion_thread_list\n
return discussion_thread_list\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_getDiscussionThreadList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -17,6 +17,7 @@
<string>list_method</string>
<string>search</string>
<string>search_columns</string>
<string>selection_name</string>
<string>sort</string>
<string>sort_columns</string>
<string>title</string>
......@@ -210,6 +211,10 @@
</list>
</value>
</item>
<item>
<key> <string>selection_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>sort</string> </key>
<value>
......@@ -281,7 +286,7 @@
<dictionary>
<item>
<key> <string>method_name</string> </key>
<value> <string>getDocumentValueList</string> </value>
<value> <string>WebSection_getDiscussionThreadList</string> </value>
</item>
</dictionary>
</pickle>
......
125
\ No newline at end of file
126
\ 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