Exemplo n.º 1
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     data = json.loads(self.request.body)
     anki_info = storage()
     anki_info.user_name = data['user_name']
     anki_info.password = data['password']
     anki_info.user_id = self.current_user
     db_bz.insertOrUpdate(pg, 'anki', anki_info,
                          "user_id='%s'" % anki_info.user_id)
     anki.getMidAndCsrfTokenHolder(anki_info.user_id, reset_cookie=True)
     self.write(json.dumps(self.data))
Exemplo n.º 2
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     data = json.loads(self.request.body)
     god_id = data['god_id']
     remark = data['remark']
     where = "user_id='%s' and god_id=%s" % (self.current_user, god_id)
     values = storage()
     values.user_id = self.current_user
     values.remark = remark
     values.god_id = god_id
     db_bz.insertOrUpdate(pg, 'remark', values, where)
     self.write(json.dumps({'error': '0'}))
    def post(self):

        self.set_header("Content-Type", "application/json")
        data = json.loads(self.request.body)

        openid = self.get_secure_cookie("openid")
        #openid = 123
        data['openid'] = openid
        #where = "openid='%s' and card_number='%s' " % (openid, data['card_number'])
        where = "openid='%s' " % openid
        db_bz.insertOrUpdate(pg, 'bind_card_info', data, where)

        self.write(json.dumps({'error': '0'}))
Exemplo n.º 4
0
def insertOrUpdate(*args, **kwargs):
    return db_bz.insertOrUpdate(*args, **kwargs)
Exemplo n.º 5
0
def insertOrUpdate(*args, **kwargs):
    return db_bz.insertOrUpdate(*args, **kwargs)