1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-03-04 08:38:06 +00:00

15 lines
466 B
Python
Raw Normal View History

from django.contrib.syndication.feeds import Feed
from django_website.apps.blog.models import Entry
import datetime
class WeblogEntryFeed(Feed):
title = "The Django weblog"
link = "http://www.djangoproject.com/weblog/"
description = "Latest news about Django, the Python Web framework."
def items(self):
return Entry.objects.filter(pub_date__lte=datetime.datetime.now())[:10]
def item_pubdate(self, item):
return item.pub_date