コード例 #1
0
ファイル: url_short.py プロジェクト: zhourongyu/DotaNews
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
コード例 #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)
コード例 #3
0
def post_msg(who, text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)', who, text)
コード例 #4
0
ファイル: foo.py プロジェクト: 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)
コード例 #5
0
ファイル: foo.py プロジェクト: 42qu/zqa
def post_msg(who,text):
    return _db.execute('insert into `msg` (who,t) values (%s,%s)',
            who,text)
コード例 #6
0
ファイル: foo.py プロジェクト: 42qu/zqa
def chooseanswer(msg_id,reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' 
            % (reply_id,msg_id))
コード例 #7
0
def chooseanswer(msg_id, reply_id):
    return _db.execute('update `msg` set answer_id = %s where id=%s' %
                       (reply_id, msg_id))