コード例 #1
0
    def get(self, parm):

        self.set_header("Content-Type", "application/json")
        parm = json.loads(parm)
        cat = parm['cat']

        recommand = None
        if cat == 'recommand':
            cat = None
            recommand = True
        if self.current_user:
            if cat == 'all':  # 特殊处理,显示所有我没关注的god
                gods = oper.getGods(self.current_user, recommand=recommand)
            else:
                gods = oper.getGods(self.current_user,
                                    cat=cat,
                                    recommand=recommand,
                                    is_public=True)
        else:
            gods = oper.getGods(cat=cat, recommand=recommand, is_public=True)
        self.write(
            json.dumps({
                'error': '0',
                'gods': gods
            }, cls=json_bz.ExtEncoder))
コード例 #2
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     gods = oper.getGods(self.current_user, recommand=True)
     self.write(
         json.dumps({
             'error': '0',
             'gods': gods
         }, cls=public_bz.ExtEncoder))
コード例 #3
0
 def get(self, parm):
     self.set_header("Content-Type", "application/json")
     parm = json.loads(parm)
     cat = parm.get('cat')
     is_my = parm.get('is_my')
     blocked = parm.get('blocked')
     gods = oper.getGods(cat=cat,
                         is_my=is_my,
                         blocked=blocked,
                         user_id=self.current_user)
     self.write(
         json.dumps({
             'error': '0',
             'gods': gods
         }, cls=json_bz.ExtEncoder))
コード例 #4
0
    def get(self, parm):

        self.set_header("Content-Type", "application/json")
        parm = json.loads(parm)
        cat = parm.get('cat')
        before = parm.get('before')
        limit = parm.get('limit')

        if before:
            before = time_bz.timestampToDateTime(before, True)

        gods = oper.getGods(self.current_user,
                            cat=cat,
                            is_public=True,
                            limit=limit,
                            before=before)

        self.write(
            json.dumps({
                'error': '0',
                'gods': gods
            }, cls=json_bz.ExtEncoder))
コード例 #5
0
 def get(self):
     #users = public_db.getUserInfoTwitterUser(self.current_user)
     gods = oper.getGods(self.current_user)
     self.render(self.template, users=gods)
コード例 #6
0
 def post(self):
     self.set_header("Content-Type", "application/json")
     gods = oper.getGods(self.current_user)
     self.write(json.dumps({'error': '0', 'gods': gods}, cls=public_bz.ExtEncoder))
コード例 #7
0
 def get(self):
     #users = public_db.getUserInfoTwitterUser(self.current_user)
     gods = oper.getGods(self.current_user)
     self.render(self.template, users=gods)