Beispiel #1
0
def update_note(tid):
    user = session.get("user",None)
    if not user:
        return "no user found", 401
    if request.method=="GET":
        quilltext = db.get_quill_by_id(tid)
        text = quilltext.text
        html = quilltext.html
        db.add_click_quill(tid)
        return html
    elif request.method == "POST":
        html = request.form["html"]
        text = request.form["text"]
        header = text.split("\n")[0]
        values = {"html":html,
                  "header":header,
                  "text":text}
        db.update_quill(tid, values)
        return header
Beispiel #2
0
# -*- coding: cp936 -*-
import db

##values = {"header":"testpybbb","text":"pythonsdft",
##          "html":"<div>python test result</div>",
##          "user_id":"abc",
##          "regin_id":1}
##quil = db.add_quill(values)
##print quil.id
##
for i in db.get_quill_header_by_regin(1, "test"):
    print i.header, i.click_count

db.add_click_quill(1)
##print  db.get_quill_by_id(1).text

##values = {"text":"change","html":"<div>chagne</div>"}
##db.update_quill(1,values)

##values = {"title":u"Éú»î"}
##regin = db.add_regin(values)
##print regin.id, regin.title

##for i in db.query_text(u"±ØÒª"):
##    print i.id
##    print "+++"
Beispiel #3
0
# -*- coding: cp936 -*-
import db


##values = {"header":"testpybbb","text":"pythonsdft",
##          "html":"<div>python test result</div>",
##          "user_id":"abc",
##          "regin_id":1}
##quil = db.add_quill(values)
##print quil.id
##
for i in db.get_quill_header_by_regin(1,"test"):
    print  i.header, i.click_count
    

db.add_click_quill(1)    
##print  db.get_quill_by_id(1).text

##values = {"text":"change","html":"<div>chagne</div>"}
##db.update_quill(1,values)

##values = {"title":u"Éú»î"}
##regin = db.add_regin(values)
##print regin.id, regin.title

##for i in db.query_text(u"±ØÒª"):
##    print i.id
##    print "+++"