Commit 789a8e80 authored by Jérome Perrin's avatar Jérome Perrin

post: WIP

* data is saved "as is"
* support a source_reference property for "message ID" and like
* no proxy roles.

TODO:
* one script seem enough
parent fd92dbc5
......@@ -73,6 +73,7 @@
<value>
<list>
<string>my_title</string>
<string>my_source_reference</string>
</list>
</value>
</item>
......
# XXX do we need two scripts ??
portal = context.getPortalObject()
# create an HTML Post
......@@ -8,6 +10,8 @@ post_edit_kw = {
"start_date": now,
"follow_up_value": context.getPortalObject().restrictedTraverse(follow_up),
"text_content": data,
"source_reference": source_reference,
"title": title,
}
if predecessor not in (None, ""):
predecessor_value, = portal.portal_catalog(relative_url=predecessor, limit=2)
......
......@@ -50,16 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>follow_up, data, predecessor=None, immediate_reindex_context_manager=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
<value> <string>follow_up, data, predecessor=None, source_reference=None, title=None, immediate_reindex_context_manager=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
return context.PostModule_createHTMLPost(
title=data.splitlines()[0][:30] if data else None,
source_reference=source_reference,
data=data,
follow_up=follow_up,
predecessor=predecessor,
data="<p>" + data.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;").replace(" ", " &nbsp;").replace("\n", "<br/>") + "</p>",
immediate_reindex_context_manager=immediate_reindex_context_manager,
)
......@@ -50,16 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>follow_up, data, predecessor=None, immediate_reindex_context_manager=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
<value> <string>follow_up, data, source_reference, predecessor=None, immediate_reindex_context_manager=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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