def _read_group(request, group):
    url = request.route_url('group_read', pubid=group.pubid, slug=group.slug)

    result = search.search(request,
                           private=False,
                           params={"group": group.pubid, "limit": 1000})
    annotations = [presenters.AnnotationHTMLPresenter(
                       storage.annotation_from_dict(a))
                   for a in result['rows']]

    # Group the annotations by URI.
    # Create a dict mapping the (normalized) URIs of the annotated documents
    # to the most recent annotation of each document.
    annotations_by_uri = collections.OrderedDict()
    for annotation in annotations:
        normalized_uri = uri.normalize(annotation.uri)
        if normalized_uri not in annotations_by_uri:
            annotations_by_uri[normalized_uri] = annotation
            if len(annotations_by_uri) >= 25:
                break

    document_links = [annotation.document_link
                      for annotation in annotations_by_uri.values()]

    template_data = {
        'group': group,
        'group_url': url,
        'document_links': document_links
    }

    return renderers.render_to_response(
        renderer_name='h:templates/groups/share.html.jinja2',
        value=template_data, request=request)
Return contents of object.
dataset/ETHPy150Open hypothesis/h/h/groups/views.py/_read_group--crossover with--dataset/ETHPy150Open ryan-roemer/django-cloud-browser/cloud_browser/cloud/boto_base.py/BotoObject._read