def zsite_member_with_review(id): member_list = zsite_member_admin_list(id) review_list = po_review_list_active_by_zsite_id(id) review2member = dict((i.user_id, i) for i in review_list) career_bind(member_list) result_with_review = [] result_without_review = [] for i in member_list: mid = i.id if mid in review2member: review = review2member[mid] if not review.name_: review = None else: review = None i.review = review if review is None: result_without_review.append(i) else: result_with_review.append(i) result_with_review.extend(result_without_review) return result_with_review
def event_joiner_list(event_id, limit, offset): id_list = event_joiner_id_list(event_id, limit, offset) li = EventJoiner.mc_get_list(id_list) split_before_id = event_joiner_split_before_id(li) Zsite.mc_bind(li, 'user', 'user_id') user_list = [i.user for i in li] namecard_bind(user_list) career_bind(user_list) pic_url_bind_with_default(user_list, '96') return li, split_before_id
def zsite_json(zsite_id, zsite_list): ico_url_bind(zsite_list) zsite_id_list = tuple(i.id for i in zsite_list) user_list = [] for i in zsite_list: if i.cid == CID_USER: user_list.append(i) career_bind(user_list) motto_dict = motto.get_dict(zsite_id_list) result = [] for i, is_follow in zip( zsite_list, follow_get_list(zsite_id, zsite_id_list) ): career = (' , '.join(filter(bool, i.career)) if i.cid==CID_USER else 0) or 0 _motto = motto_dict.get(i.id) or 0 if _motto: length = 14 if not career: length += length _motto = cnenoverflow(_motto, length)[0] if is_follow and is_follow is not True: is_follow = 1 result.append(( i.id, #0 i.link, #1 i.name, #2 i.ico, #3 career, #4 i.cid , #5 _motto , #6 is_follow , #7 )) return result
def zsite_json(zsite_id, zsite_list): ico_url_bind(zsite_list) zsite_id_list = tuple(i.id for i in zsite_list) user_list = [] for i in zsite_list: if i.cid == CID_USER: user_list.append(i) career_bind(user_list) motto_dict = motto.get_dict(zsite_id_list) result = [] for i, is_follow in zip(zsite_list, follow_get_list(zsite_id, zsite_id_list)): career = (' , '.join(filter(bool, i.career)) if i.cid == CID_USER else 0) or 0 _motto = motto_dict.get(i.id) or 0 if _motto: length = 14 if not career: length += length _motto = cnenoverflow(_motto, length)[0] if is_follow and is_follow is not True: is_follow = 1 result.append(( i.id, #0 i.link, #1 i.name, #2 i.ico, #3 career, #4 i.cid, #5 _motto, #6 is_follow, #7 )) return result
def po_review_bind(review_list): Zsite.mc_bind(review_list, 'user', 'user_id') career_bind(i.user for i in review_list)