Exemplo n.º 1
0
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()
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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()
Exemplo n.º 4
0
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()
Exemplo n.º 5
0
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()