From 772a500534a508b5b9f88e2883c8dcb488c4b4d9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 13 Jul 2013 09:50:45 -0500 Subject: 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 --- feeds.py | 8 ++++++-- templates/feeds/news_title.html | 1 - templates/feeds/packages_description.html | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 templates/feeds/news_title.html delete mode 100644 templates/feeds/packages_description.html diff --git a/feeds.py b/feeds.py index 9721f41..678bebc 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 7899fce..0000000 --- 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 cfc4261..0000000 --- a/templates/feeds/packages_description.html +++ /dev/null @@ -1 +0,0 @@ -{{ obj.pkgdesc }} \ No newline at end of file -- cgit v1.2.3-24-g4f1b