summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-07-13 09:50:45 -0500
committerDan McGee <dan@archlinux.org>2013-07-13 09:50:45 -0500
commit772a500534a508b5b9f88e2883c8dcb488c4b4d9 (patch)
tree31ba2f39f03371a85f262e8fdc7183a332518507
parent9e4a0939145505e7f606ee8b66ea1acd092abb85 (diff)
Move simple feeds templates directly into feed classes
No need to call out to the template engine to format... nothing at all. Just fetch the attribute directly and save the render step. Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--feeds.py8
-rw-r--r--templates/feeds/news_title.html1
-rw-r--r--templates/feeds/packages_description.html1
3 files changed, 6 insertions, 4 deletions
diff --git a/feeds.py b/feeds.py
index 9721f41c..678bebcf 100644
--- a/feeds.py
+++ b/feeds.py
@@ -49,7 +49,6 @@ class PackageFeed(Feed):
link = '/packages/'
title_template = 'feeds/packages_title.html'
- description_template = 'feeds/packages_description.html'
def __call__(self, request, *args, **kwargs):
wrapper = condition(etag_func=package_etag, last_modified_func=package_last_modified)
@@ -112,6 +111,9 @@ class PackageFeed(Feed):
def item_pubdate(self, item):
return item.last_update
+ def item_description(self, item):
+ return item.pkgdesc
+
def item_categories(self, item):
return (item.repo.name, item.arch.name)
@@ -133,7 +135,6 @@ class NewsFeed(Feed):
link = '/news/'
description = 'The latest and greatest news from the Arch Linux distribution.'
subtitle = description
- title_template = 'feeds/news_title.html'
description_template = 'feeds/news_description.html'
def __call__(self, request, *args, **kwargs):
@@ -155,6 +156,9 @@ class NewsFeed(Feed):
def item_author_name(self, item):
return item.author.get_full_name()
+ def item_title(self, item):
+ return item.title
+
class ReleaseFeed(Feed):
feed_type = GuidNotPermalinkFeed
diff --git a/templates/feeds/news_title.html b/templates/feeds/news_title.html
deleted file mode 100644
index 7899fce3..00000000
--- a/templates/feeds/news_title.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ obj.title }} \ No newline at end of file
diff --git a/templates/feeds/packages_description.html b/templates/feeds/packages_description.html
deleted file mode 100644
index cfc42616..00000000
--- a/templates/feeds/packages_description.html
+++ /dev/null
@@ -1 +0,0 @@
-{{ obj.pkgdesc }} \ No newline at end of file