Ejemplo n.º 1
0
def buzz_at_list(user_id, limit, offset):
    po_id_list = []
    reply_id_list = []
    user_id_list = []
    id_list = []
    for id, from_id, po_id, reply_id in buzz_at_col_list(user_id, limit, offset):
        id_list.append(id)
        po_id_list.append(po_id)
        reply_id_list.append(reply_id)
        user_id_list.append(from_id)

    from model.zsite import Zsite
    from model.po import Po
    from model.reply import Reply
    return tuple(zip(
        id_list,
        Zsite.mc_get_list(user_id_list),
        Po.mc_get_list(po_id_list),
        Reply.mc_get_list(reply_id_list),
    ))
Ejemplo n.º 2
0
def po_list_by_buzz_reply_user_id(user_id):
    from model.po import Po
    from model.po_pos import po_pos_get_last_reply_id
    from model.reply import Reply
    from model.buzz_po_bind_user import buzz_po_bind_user

    id_list = po_id_list_by_buzz_reply_user_id(user_id)
    po_list = Po.mc_get_list(id_list)

    po_user_id = []
    for i in po_list:
        pos = po_pos_get_last_reply_id(user_id, i.id)
        new_reply_id_list = []
        for reply_id in i.reply_id_list():
            if reply_id > pos:
                new_reply_id_list.append(reply_id)

        user_id_list = []
        for reply in Reply.mc_get_list(reversed(new_reply_id_list)):
            user_id_list.append(reply.user_id)
        po_user_id.append(user_id_list)

    return buzz_po_bind_user(po_list, po_user_id, user_id)