1. Michael Elsdörfer
  2. djutils

Commits

Michael Elsdörfer  committed 63ba6b9

Remove feed views.

The new syndication framework added in 1.2. replaces the need for this.

  • Participants
  • Parent commits 22af0b3
  • Branches djutils

Comments (0)

Files changed (1)

File djutils/views.py

-from django.http import HttpResponse, Http404
-from django.contrib.syndication import feeds
-import django.contrib.syndication.views
-
-def feed(request, feedclass, *args):
-    """
-    A simplified version of the feed view provided by django's syndication
-    framework. The single required parameter "feed" must be an instance of
-    django.contrib.syndication.feeds.Feed.
-
-    All additional parameters will end up as bits in the get_object() call
-    to the feed (but only strings are supported here, we need to work around
-    the limitations of django's feed framework).
-    """
-    try:
-        feedgen = feedclass("", request).get_feed(
-            # hack: pass arguments as "url" path
-            args and "/".join(map(lambda x: str(x), args)) or None
-        )
-    except feeds.FeedDoesNotExist:
-        raise Http404, "Invalid feed parameters."
-
-    response = HttpResponse(mimetype=feedgen.mime_type)
-    feedgen.write(response, 'utf-8')
-    return response
-
-class Feed(feeds.Feed):
-    """
-    Simple feed class that has the render-feed view built-in.
-    """
-    @classmethod
-    def render(self, request, *args):
-        return feed(request, self, *args)