Esempio n. 1
0
def url_short_new(url):
    id = _db.get( 'select `id` from url_short where url=%s limit 1', url)
    if id:
        id = id.id
    else:
        id = _db.execute( 'insert into `url_short` (url) values (%s)', url)
    return id
Esempio n. 2
0
def post_reply(msg_id, who, text):
    return _db.execute('insert into `reply` (msg_id,who,t) values (%s,%s,%s)',
                       msg_id, who, text)
Esempio n. 3
0
def post_msg(who, text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)', who, text)
Esempio n. 4
0
File: foo.py Progetto: 42qu/zqa
def post_reply(msg_id,who,text):
    return _db.execute(
        'insert into `reply` (msg_id,who,t) values (%s,%s,%s)',
        msg_id,who,text)
Esempio n. 5
0
File: foo.py Progetto: 42qu/zqa
def post_msg(who,text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)',
            who,text)
Esempio n. 6
0
File: foo.py Progetto: 42qu/zqa
def chooseanswer(msg_id,reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' 
            % (reply_id,msg_id))
Esempio n. 7
0
def chooseanswer(msg_id, reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' %
                       (reply_id, msg_id))