当前位置: 首页>>代码示例>>Python>>正文


Python Po.mc_get_list方法代码示例

本文整理汇总了Python中po.Po.mc_get_list方法的典型用法代码示例。如果您正苦于以下问题:Python Po.mc_get_list方法的具体用法?Python Po.mc_get_list怎么用?Python Po.mc_get_list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在po.Po的用法示例。


在下文中一共展示了Po.mc_get_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: po_event_feedback_list

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_event_feedback_list(event_id):
    ids = rank_po_id_list(event_id, CID_EVENT_FEEDBACK, 'confidence')

    li = Po.mc_get_list(ids)
    Zsite.mc_bind(li, 'user', 'user_id')

    return li
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2: po_user_id_list

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_user_id_list(question_id):
    question = Po.mc_get(question_id)
    user_id = question.user_id
    po_id_list = rank_po_id_list(question_id, CID_QUESTION, 'confidence')
    po_list = Po.mc_get_list(po_id_list)
    user_id_list = [i.user_id for i in po_list]
    user_id_list.append(user_id)
    return set(user_id_list)
开发者ID:,项目名称:,代码行数:10,代码来源:

示例3: event_joiner_by_owner_id

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def event_joiner_by_owner_id(user_id):
    event_id_list = event_id_list_by_zsite_id(user_id, False, None, None)
    result = []
    if event_id_list:
        event_id_list_with_count = []
        event_id_count_list = []
        for id, count in zip(
            event_id_list,
            event_joiner_new_count.get_list(event_id_list)
        ):
            if count:
                event_id_list_with_count.append(id)
                event_id_count_list.append(count)

        for po, count in zip(
            Po.mc_get_list(event_id_list_with_count),
            event_id_count_list
        ):
            result.append((po.id, po.name, count))
    return result
开发者ID:,项目名称:,代码行数:22,代码来源:

示例4: po_answer_list

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_answer_list(question_id, zsite_id=0, user_id=0):
    ids = rank_po_id_list(question_id, CID_QUESTION, 'confidence')

    if zsite_id == user_id:
        zsite_id = 0

    user_ids = filter(bool, (zsite_id, user_id))
    if user_ids:
        _ids = []
        for i in user_ids:
            user_answer_id = answer_id_get(i, question_id)
            if user_answer_id:
                _ids.append(user_answer_id)
                if user_answer_id in ids:
                    ids.remove(user_answer_id)
        if _ids:
            _ids.extend(ids)
            ids = _ids

    li = Po.mc_get_list(ids)
    Zsite.mc_bind(li, 'user', 'user_id')
    return li
开发者ID:,项目名称:,代码行数:24,代码来源:

示例5: fav_po_list_by_user_id_cid

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def fav_po_list_by_user_id_cid(user_id, cid, limit, offset=0):
    id_list = fav_po_id_list_by_user_id_cid(user_id, cid, limit, offset)
    if cid == CID_EVENT:
        return zip(Event.mc_get_list(id_list), Po.mc_get_list(id_list))
    return Po.mc_get_list(id_list)
开发者ID:,项目名称:,代码行数:7,代码来源:

示例6: product_list_by_com_id

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def product_list_by_com_id(com_id):
    return Po.mc_get_list(product_id_list_by_com_id(com_id))
开发者ID:,项目名称:,代码行数:4,代码来源:

示例7: count_po_list_by_zsite_tag_id_cid

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def count_po_list_by_zsite_tag_id_cid(zsite_tag_id, cid, limit=6):
    return (
        zsite_tag_cid_count(zsite_tag_id, cid),
        Po.mc_get_list(po_id_list_by_zsite_tag_id_cid(zsite_tag_id, cid, limit))
    )
开发者ID:,项目名称:,代码行数:7,代码来源:

示例8: po_list_by_zsite_id

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_list_by_zsite_id(zsite_id, cid , limit, offset):
    return Po.mc_get_list(po_id_list_by_zsite_id(
        zsite_id, cid , limit, offset
    ))
开发者ID:,项目名称:,代码行数:6,代码来源:

示例9: po_review_show_list_with_user

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_review_show_list_with_user(id):
    review_list = Po.mc_get_list(po_review_show_id_list(id))
    po_review_bind(review_list)
    return review_list
开发者ID:,项目名称:,代码行数:6,代码来源:

示例10: event_end_list_by_city_pid

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def event_end_list_by_city_pid(city_pid, limit, offset):
    id_list = event_end_id_list_by_city_pid(city_pid, limit, offset)
    return zip(Event.mc_get_list(id_list), Po.mc_get_list(id_list))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例11: event_list_by_city_pid_cid

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def event_list_by_city_pid_cid(city_pid, cid, limit=10, offset=0):
    id_list = event_id_list_by_city_pid_cid(city_pid, cid, limit, offset)
    return zip(Event.mc_get_list(id_list), Po.mc_get_list(id_list))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例12: event_list_by_zsite_id

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def event_list_by_zsite_id(zsite_id, can_admin, limit, offset):
    id_list = event_id_list_by_zsite_id(zsite_id, bool(can_admin), limit, offset)
    return zip(Event.mc_get_list(id_list), Po.mc_get_list(id_list))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例13: event_all_list

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def event_all_list(limit, offset):
    id_list = event_all_id_list(limit, offset)
    return zip(Event.mc_get_list(id_list), Po.mc_get_list(id_list))
开发者ID:,项目名称:,代码行数:5,代码来源:

示例14: po_event_notice_list_by_event_id

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
def po_event_notice_list_by_event_id(event_id):
    return Po.mc_get_list(
        po_event_notice_id_list_by_event_id(event_id)
    )
开发者ID:,项目名称:,代码行数:6,代码来源:

示例15: can_admin

# 需要导入模块: from po import Po [as 别名]
# 或者: from po.Po import mc_get_list [as 别名]
    def can_admin(self, user_id):
        if user_id:
            return self.user_id == user_id


def mc_flush_reply_id_list(cid, rid):
    key = '%s_%s' % (cid, rid)
    mc_reply_id_list.delete(key)
    mc_reply_id_list_reversed.delete(key)
    mc_reply_count.delete(key)
    mc_reply_zsite_id_list.delete(key)



if __name__ == '__main__':
    r = Reply.raw_sql('select *,count(rid) from reply where cid = 62 group by rid order by count(rid) desc limit 50').fetchall()
    from po import Po
    p_l,c_l = [],[]
    for i in r:
        p_l.append(i[1])
        c_l.append(i[-1])
    p = Po.mc_get_list(p_l)
    p = filter(lambda x:x,p)
    p = map(lambda x:(x.name,x.txt,'http:%s'%x.link),p)
    res = zip(p,c_l[1:])
    for n,((i,l,j),k) in enumerate(res):
        print '#'*20
        print '第%s名:'%(n+1),i,j,'\n','回复数:',k,
        print l,'\n\n'
    pass
开发者ID:,项目名称:,代码行数:32,代码来源:


注:本文中的po.Po.mc_get_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。