コード例 #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
ファイル: feed.py プロジェクト: tanveerahmad1517/myewb2
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