[1.8.x] Fixed #25369 -- Corrected syndication's get_object() example.

Backport of 64d7a553e1 from master
This commit is contained in:
Tim Graham 2015-09-14 15:29:10 -04:00
parent d0d2567120
commit 8388f24e79
1 changed files with 1 additions and 2 deletions

View File

@ -225,13 +225,12 @@ method along with the request object.
Here's the code for these beat-specific feeds:: Here's the code for these beat-specific feeds::
from django.contrib.syndication.views import Feed from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
class BeatFeed(Feed): class BeatFeed(Feed):
description_template = 'feeds/beat_description.html' description_template = 'feeds/beat_description.html'
def get_object(self, request, beat_id): def get_object(self, request, beat_id):
return get_object_or_404(Beat, pk=beat_id) return Beat.objects.get(pk=beat_id)
def title(self, obj): def title(self, obj):
return "Police beat central: Crimes for beat %s" % obj.beat return "Police beat central: Crimes for beat %s" % obj.beat