示例#1
0
    def post(self):

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

        id = db_bz.insertIfNotExist(pg, 'user_info', data, "user_name='%s'" % data['user_name'])
        if id is None:
            where = "user_name='%s'" % data['user_name']
            self.pg.update("user_info", where=where, **data)
            id = self.pg.select('user_info', where=where)[0].id

        oper.follow(self.current_user, id, make_sure=False)

        self.write(json.dumps({'error': '0'}))
示例#2
0
    def post(self):

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

        id = db_bz.insertIfNotExist(pg, 'user_info', data,
                                    "user_name='%s'" % data['user_name'])
        if id is None:
            where = "user_name='%s'" % data['user_name']
            self.pg.update("user_info", where=where, **data)
            id = self.pg.select('user_info', where=where)[0].id

        oper.follow(self.current_user, id, make_sure=False)

        self.write(json.dumps({'error': '0'}))
示例#3
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     data = json.loads(self.request.body)
     oper.follow(self.current_user, data['god_id'])
     self.write(json.dumps({'error': '0'}))
示例#4
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     data = json.loads(self.request.body)
     oper.follow(self.current_user, data['god_id'])
     self.write(json.dumps({'error': '0'}))