Ejemplo n.º 1
0
Archivo: lib.py Proyecto: jun0205/june
def get_full_topics(topics):
    users = get_cache_list(Member, get_user_id_list(topics), 'member:')
    nodes = get_cache_list(Node, (t.node_id for t in topics), 'node:')
    for topic in topics:
        if topic.user_id in users and topic.node_id in nodes:
            topic.user = users[topic.user_id]
            if topic.last_reply_by:
                topic.replyer = users[topic.last_reply_by]
            else:
                topic.replyer = None
            topic.node = nodes[topic.node_id]
            yield topic
Ejemplo n.º 2
0
def get_full_notifications(messages):
    users = get_cache_list(Member, (m.sender for m in messages), 'member:')
    for msg in messages:
        if msg.sender in users:
            msg.who = users[msg.sender]
            yield msg
Ejemplo n.º 3
0
Archivo: lib.py Proyecto: accexine/june
def get_full_notifications(messages):
    users = get_cache_list(Member, (m.sender for m in messages), 'member:')
    for msg in messages:
        if msg.sender in users:
            msg.who = users[msg.sender]
            yield msg
Ejemplo n.º 4
0
Archivo: lib.py Proyecto: jun0205/june
def get_full_replies(replies):
    users = get_cache_list(Member, (r.user_id for r in replies), 'member:')
    for reply in replies:
        if reply.user_id in users:
            reply.user = users[reply.user_id]
            yield reply