Ticket #18112: feedviews.diff
File feedviews.diff, 1.8 KB (added by , 13 years ago) |
---|
-
django/contrib/syndication/views.py
90 90 def get_object(self, request, *args, **kwargs): 91 91 return None 92 92 93 def get_context_data(self, **kwargs): 94 """ 95 Returns a dictionary to use as extra context if either 96 ``self.description_template`` or ``self.item_template`` are used. 97 98 Default implementation preserves the old behavior 99 of using {'obj': item, 'site': current_site} as the context. 100 """ 101 return {'obj': kwargs.get('item'), 'site': kwargs.get('site')} 102 93 103 def get_feed(self, obj, request): 94 104 """ 95 105 Returns a feedgenerator.DefaultFeed object, fully populated, for … … 136 146 pass 137 147 138 148 for item in self.__get_dynamic_attr('items', obj): 149 context = self.get_context_data(item=item, site=current_site, 150 obj=obj, request=request) 139 151 if title_tmp is not None: 140 title = title_tmp.render(RequestContext(request, {'obj': item, 'site': current_site}))152 title = title_tmp.render(RequestContext(request, context)) 141 153 else: 142 154 title = self.__get_dynamic_attr('item_title', item) 143 155 if description_tmp is not None: 144 description = description_tmp.render(RequestContext(request, {'obj': item, 'site': current_site}))156 description = description_tmp.render(RequestContext(request, context)) 145 157 else: 146 158 description = self.__get_dynamic_attr('item_description', item) 147 159 link = add_domain(