def getGods(user_id=None, recommand=False, is_my=None, cat=None, is_public=None, limit=None, before=None, blocked=None): ''' create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github modify by bigzhu at 15/08/28 17:05:54 可以查出没关注的,和随机的 modify by bigzhu at 16/01/27 17:15:15 过滤出满足条件的 modify by bigzhu at 16/04/11 11:47:54 查看我的关注时候,不要限定关注数 modify by bigzhu at 16/05/27 21:52:06 让所有god都能看到 ''' gods = list( public_db.getGodInfoFollow(user_id=user_id, recommand=recommand, is_my=is_my, cat=cat, is_public=is_public, limit=limit, before=before, blocked=blocked)) return gods
def post(self): self.set_header("Content-Type", "application/json") data = json.loads(self.request.body) god_name = data.get('user_name', None) god_info = list(public_db.getGodInfoFollow(self.current_user, god_name)) if god_info: god_info = god_info[0] oper.makeSurePicture(god_info) self.write(json.dumps({'error': '0', 'user_info': god_info}, cls=public_bz.ExtEncoder))
def get(self): god_name = self.get_argument('god_name') limit = self.get_argument('limit', None) god_info = list(public_db.getGodInfoFollow(self.current_user, god_name)) if god_info: god_info = god_info[0] oper.makeSurePicture(god_info) messages, more, anchor = oper.getMessages(limit, god_name=god_name) #messages = public_db.getMessages(god_name=god_name) self.render(self.template, god_info=god_info, messages=messages, more=more, anchor=anchor)
def getGods(user_id, recommand=False): ''' create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github modify by bigzhu at 15/08/28 17:05:54 可以查出没关注的,和随机的 ''' gods = list(public_db.getGodInfoFollow(user_id, recommand=recommand)) #will_del = [] for god in gods: god = getGodSocialInfo(god) return gods
def getGodInfo(god_name, user_id=None): ''' create by bigzhu at 15/11/27 10:31:48 查某个god ''' gods = list(public_db.getGodInfoFollow(user_id, god_name=god_name)) if gods: god = gods[0] else: raise Exception('没有查到god:' + god_name) god = getGodSocialInfo(god) return god
def getGods(user_id, recommand=False): ''' create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github modify by bigzhu at 15/08/28 17:05:54 可以查出没关注的,和随机的 modify by bigzhu at 16/01/27 17:15:15 过滤出满足条件的 ''' gods = list(public_db.getGodInfoFollow(user_id, recommand=recommand)) #will_del = [] have_social_gods = [] for god in gods: god = getGodSocialInfo(god) if isHaveGoodSocial(god): have_social_gods.append(god) return have_social_gods
def post(self): self.set_header("Content-Type", "application/json") data = json.loads(self.request.body) god_name = data.get('user_name', None) god_info = list(public_db.getGodInfoFollow(self.current_user, god_name)) if god_info: god_info = god_info[0] self.write( json.dumps({ 'error': '0', 'user_info': god_info }, cls=json_bz.ExtEncoder))
def getGods(user_id): ''' create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github ''' gods = list(public_db.getGodInfoFollow(user_id)) will_del = [] for god in gods: god.twitter_user = public_db.getTwitterUser(god.twitter) god.github_user = public_db.getGithubUser(god.github) god.instagram_user = public_db.getInstagramUser(god.instagram) if god.twitter_user is None and god.github_user is None and god.instagram_user is None: will_del.append(god) for god in will_del: gods.remove(god) return gods
def getGods(user_id, recommand=False): ''' create by bigzhu at 15/07/12 23:43:54 显示所有的大神, 关联twitter modify by bigzhu at 15/07/17 15:20:26 关联其他的,包括 github modify by bigzhu at 15/08/28 17:05:54 可以查出没关注的,和随机的 ''' gods = list(public_db.getGodInfoFollow(user_id, recommand=recommand)) #will_del = [] for god in gods: god.twitter_user = public_db.getTwitterUser(god.twitter) god.github_user = public_db.getGithubUser(god.github) god.instagram_user = public_db.getInstagramUser(god.instagram) #if god.twitter_user is None and god.github_user is None and god.instagram_user is None: # print god # will_del.append(god) #for god in will_del: # gods.remove(god) return gods