def update_textblob_metadata(blob) : """Adds the tags in the text of a text blob to the tags table in the blob.""" action_assert(blob["doc"]["type"] == "text") blob["tags"].update(get_prepared_tags_for_db(blob["doc"]["text_content"])) raise DeferAction()
def textblob_to_html(render_string, blob, a_data) : do_query = make_query_maker(render_string, blob) action_assert(blob["doc"]["type"] == "text") tags, tag_data, html = markup.parse_markup(blob["doc"]["text_content"], { "blobbase" : blob["doc"]["blob_base"], "query" : do_query, }) a_data["content"] = a_data.get("content", "") + \ markup.parse_tags(format_tag_value, blob, *tag_data)+html raise DeferAction()
def create_textblob(handler, doc) : action_assert(handler.get_argument("blob_type", "") == "text") doc["type"] = "text" doc["text_content"] = handler.get_argument("text_content") raise DeferAction()
def edit_textblob(handler, blob, a_data) : action_assert(handler.get_argument("blob_type", "") == "text") blob["doc"]["type"] = "text" blob["doc"]["text_content"] = handler.get_argument("text_content") raise DeferAction()
def edit_textblob(handler, blob, a_data) : action_assert(blob["doc"]["type"] == "text") a_data["content"] = handler.render_string("textblob_edit.html", prior_content=a_data.get("content", ""), text_content=blob["doc"]["text_content"]) raise DeferAction()