X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/44090c986d9a16f6913047c25319c446bb9308ad..a55d79e4c27c893841712145e38d4a4a61e04b20:/migdal/feeds.py diff --git a/migdal/feeds.py b/migdal/feeds.py old mode 100755 new mode 100644 index 93b39ce..53145c5 --- a/migdal/feeds.py +++ b/migdal/feeds.py @@ -5,7 +5,7 @@ from django.contrib.syndication.views import Feed from django.core.urlresolvers import reverse from django.shortcuts import get_object_or_404 -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext as _, string_concat from migdal import api from migdal.models import Category from migdal.settings import TYPES_DICT @@ -20,6 +20,8 @@ class EntriesFeed(Feed): category = None if type_db: entry_type = TYPES_DICT[type_db] + else: + entry_type = None return {'entry_type': entry_type, 'category': category} def title(self, obj): @@ -47,3 +49,8 @@ class EntriesFeed(Feed): def item_description(self, item): return item.lead + image = item.image.url if item.image else "/static/img/square-logo.png" + return string_concat("" % image, item.lead) + + def item_pubdate(self, item): + return item.published_at