@login_required
def tagged_photos(request, tagname, template_name="photos/tagged_photos.html"):
        
    image_filter = Q(is_public=True)

    if request.user.is_authenticated():
        image_filter = image_filter | Q(member=request.user) | Q(member__in=friend_set_for(request.user))
        
    photos = TaggedItem.objects.get_by_model(Image, tagname).filter(image_filter).order_by("-date_added")   
    group, bridge = group_and_bridge(request)
    ctx = group_context(group, bridge)
    ctx.update({
        "photos": photos,
        "tag": tagname
    })    
    return render_to_response(template_name, RequestContext(request, ctx))
Get the photos with a tag and display them
dataset/ETHPy150Open amarandon/smeuhsocial/apps/photos/views.py/tagged_photos