Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #15707 -- Made the GIS feed compatible to the class based feeds…
… and introduced a little helper view that works like the previous feed view in the syndication app which was removed in r15976. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16540 bcc190cf-cafb-0310-a4f2-bffc1f526a37
- Loading branch information
Showing
4 changed files
with
36 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from django.http import Http404 | ||
|
||
def feed(request, url, feed_dict=None): | ||
"""Provided for backwards compatibility.""" | ||
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) | ||
|
||
instance = f() | ||
instance.feed_url = getattr(f, 'feed_url', None) or request.path | ||
instance.title_template = f.title_template or ('feeds/%s_title.html' % slug) | ||
instance.description_template = f.description_template or ('feeds/%s_description.html' % slug) | ||
return instance(request) |