Example #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
Example #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)
Example #3
0
def post_msg(who, text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)', who, text)
Example #4
0
File: foo.py Project: 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)
Example #5
0
File: foo.py Project: 42qu/zqa
def post_msg(who,text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)',
            who,text)
Example #6
0
File: foo.py Project: 42qu/zqa
def chooseanswer(msg_id,reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' 
            % (reply_id,msg_id))
Example #7
0
def chooseanswer(msg_id, reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' %
                       (reply_id, msg_id))