aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/journal/feeds.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@eta.mit.edu>2009-02-01 06:25:10 -0500
committerbnewbold <bnewbold@eta.mit.edu>2009-02-01 06:25:10 -0500
commitc7b29da94d3b85ec91f0d5e2789db11a43473df5 (patch)
treea5502674da4a9ed8367f911112d34c094481e83c /bn_django/journal/feeds.py
parent0988ee83c8a8b24801624beae78ceba1bfa82d07 (diff)
downloadbnewnet-c7b29da94d3b85ec91f0d5e2789db11a43473df5.tar.gz
bnewnet-c7b29da94d3b85ec91f0d5e2789db11a43473df5.zip
lots went on:
* rss feeds * some admin interface stuff * blah running issues: * admin interface with model inheretence? * rss feeds: unicode cool? * proper year/month implementation (don't want day) * right side bar info * dating issue (datetime vs date)
Diffstat (limited to 'bn_django/journal/feeds.py')
-rw-r--r--bn_django/journal/feeds.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/bn_django/journal/feeds.py b/bn_django/journal/feeds.py
new file mode 100644
index 0000000..3577c46
--- /dev/null
+++ b/bn_django/journal/feeds.py
@@ -0,0 +1,34 @@
+from django.contrib.syndication.feeds import Feed
+from models import Entry, MicroEntry, LinkArtifact
+
+
+class LatestEntries(Feed):
+ title = "bnewbold.net journal entries"
+ link = "/journal/entries/"
+ description = " "
+
+ def items(self):
+ return Entry.objects.order_by('-date')[:5]
+
+class LatestMicroEntries(Feed):
+ title = "bnewbold.net microentries"
+ link = "/journal/microentries/"
+ description = "Quick updates"
+
+ def items(self):
+ return MicroEntry.objects.order_by('-date')[:5]
+
+class LatestLinks(Feed):
+ title = "bnewbold.net links"
+ link = "/artifacts/links/"
+ description = "Links to love"
+
+ def items(self):
+ return LinkArtifact.objects.order_by('-date')[:5]
+
+ def item_link(self,item):
+ return item.url
+
+feed_list = {'latest_entries':LatestEntries,
+ 'latest_microentries':LatestMicroEntries,
+ 'latest_links':LatestLinks }