Projet

Général

Profil

0002-display-only-published-announces-in-RSS-feed.patch

Serghei Mihai (congés, retour 15/05), 05 décembre 2016 17:24

Télécharger (1,09 ko)

Voir les différences:

Subject: [PATCH 2/4] display only published announces in RSS feed

 corbo/views.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
corbo/views.py
202 202
        self.__dict__.update(kwargs)
203 203

  
204 204
    def items(self):
205
        return models.Announce.objects.exclude(expiration_time__lt=datetime.now()).order_by('-publication_time')
205
        return models.Announce.objects.exclude(publication_time__isnull=False,
206
            expiration_time__lt=datetime.now()).order_by('-publication_time')
206 207

  
207 208
    def item_title(self, item):
208 209
        return item.title
......
214 215
        return self.feed_item_link_template.format(item.pk)
215 216

  
216 217
    def item_pubdate(self, item):
217
        return item.publication_time or item.mtime
218
        return item.publication_time
218 219

  
219 220

  
220 221
atom = AtomView()
221
-