def get_watch(self, user_id = 0, page_num = 0, page_size = 10):
        self.__base = self.__base or BaseDao()
        op            = UserProfile(self.__base)
        (total, rows) = op.get_watch_by_user(user_id, 30, page_num)

        is_big_v = False
        result   = []
        for row in rows:
            u = row.toDict()
            
            u['is_big_v'] = is_big_v
            if (is_big_v):
                is_big_v = False
            else:
                is_big_v = True
            
            (play_count, icons)   = op.get_user_content(u['userid'])
            u['total_play_count'] = play_count
            u['games']            = icons
            
            result.append(u)
        
        data             = {}
        data['watchs']   = result
        data['total']    = total
        return data
Beispiel #2
0
    def get_watch(self, user_id=0, page_num=0, page_size=10):
        self.__base = BaseDao()
        op = UserProfile(self.__base)
        (total, rows) = op.get_watch_by_user(user_id, 30, page_num)

        is_big_v = False
        result = []
        for row in rows:
            u = row.toDict()
            u['is_big_v'] = is_big_v
            result.append(u)

        data = {}
        data['users'] = result
        data['total'] = len(rows)
        return data