예제 #1
0
파일: views.py 프로젝트: divad12/myewb2
def feed(request, group_slug):
    try:
        if group_slug == 'all':
            feedgen = TopicFeedAll(group_slug, request).get_feed()
        else:
            group = BaseGroup.objects.get(slug=group_slug)
            
            # concept of a RSS feed for a logged-in user is weird, but OK...
            if group.is_visible(request.user):
                feedgen = TopicFeedGroup(group_slug, request).get_feed(group_slug)
            else:
                return HttpResponseForbidden()

    except feeds.FeedDoesNotExist:
        raise Http404, _("Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not.") % slug

    response = HttpResponse(mimetype=feedgen.mime_type)
    feedgen.write(response, 'utf-8')
    return response
예제 #2
0
def all(request):
    feedgen = TopicFeedAll(None, request).get_feed()

    response = HttpResponse(mimetype=feedgen.mime_type)
    feedgen.write(response, 'utf-8')
    return response
예제 #3
0
파일: feed.py 프로젝트: adamfk/myewb2
def all(request):
    feedgen = TopicFeedAll(None, request).get_feed()
    
    response = HttpResponse(mimetype=feedgen.mime_type)
    feedgen.write(response, 'utf-8')
    return response