app/django/contrib/syndication/views.py
author Lennard de Rijk <ljvderijk@gmail.com>
Sun, 08 Feb 2009 23:55:44 +0000
changeset 1255 9fe8c6c54933
parent 54 03e267d67478
permissions -rw-r--r--
Redone the listing in group_app.py. There is now a list_self that only shows the group application of the current user in the given a scope. The redirects point to edit or applicant when necessary. Review_overview will show all the group applications that can be reviewed in the given scope, the redirect points to review for all statusses. And list will just show all the group applications and redirect you to edit. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed

from django.contrib.syndication import feeds
from django.http import HttpResponse, Http404

def feed(request, url, feed_dict=None):
    if not feed_dict:
        raise Http404, "No feeds are registered."

    try:
        slug, param = url.split('/', 1)
    except ValueError:
        slug, param = url, ''

    try:
        f = feed_dict[slug]
    except KeyError:
        raise Http404, "Slug %r isn't registered." % slug

    try:
        feedgen = f(slug, request).get_feed(param)
    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