Ejemplo n.º 1
0
def _get_agents_real(discussion, view_def=None):
    agents = AgentProfile.db().query(AgentProfile).all()
    # TODO: Only those in the discussion...
    # look at permissions, posts, extracts... argh!

    if view_def:
        return [agent.generic_json(view_def) for agent in agents]
    else:
        return [agent.serializable() for agent in agents]
Ejemplo n.º 2
0
def get_agents(request, discussion_only=False):
    # discussion_id = int(request.matchdict['discussion_id'])
    # discussion = Discussion.get(id=discussion_id)
    view_def = request.GET.get('view')

    # if not discussion:
    #     raise HTTPNotFound(
    #         "Discussion with id '%s' not found." % discussion_id
    #     )
    agents = AgentProfile.db().query(AgentProfile).all()
    # TODO: Only those in the discussion...
    # look at permissions, posts, extracts... argh!

    if view_def:
        return [agent.generic_json(view_def) for agent in agents]
    else:
        return [agent.serializable() for agent in agents]