From d0c863efe1e0e2b0b2d41c6482c42733a1b57df4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20St=C4=99pniowski?= Date: Tue, 21 Apr 2009 00:20:24 +0200 Subject: [PATCH] =?utf8?q?Zmiana=20adresu=20URL=20z=20aktualno=C5=9Bciami?= =?utf8?q?=20i=20konwertowanie=20adresu=20z=20unicode=20do=20str=20w=20tag?= =?utf8?q?u=20latest=5Fblog=5Fposts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apps/catalogue/templatetags/catalogue_tags.py | 10 +++++----- wolnelektury/templates/catalogue/main_page.html | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/catalogue/templatetags/catalogue_tags.py b/apps/catalogue/templatetags/catalogue_tags.py index 3c34e8cdd..d3f608ac9 100644 --- a/apps/catalogue/templatetags/catalogue_tags.py +++ b/apps/catalogue/templatetags/catalogue_tags.py @@ -1,4 +1,7 @@ # -*- coding: utf-8 -*- +import feedparser +import datetime + from django import template from django.template import Node, Variable from django.utils.encoding import smart_str @@ -190,12 +193,9 @@ class CatalogueURLNode(Node): @register.inclusion_tag('catalogue/latest_blog_posts.html') -def latest_blog_posts(feed_url, posts_to_show=5): - import feedparser - import datetime - +def latest_blog_posts(feed_url, posts_to_show=5): try: - feed = feedparser.parse(feed_url) + feed = feedparser.parse(str(feed_url)) posts = [] for i in range(posts_to_show): pub_date = feed['entries'][i].updated_parsed diff --git a/wolnelektury/templates/catalogue/main_page.html b/wolnelektury/templates/catalogue/main_page.html index 43a3636f7..af48f8402 100644 --- a/wolnelektury/templates/catalogue/main_page.html +++ b/wolnelektury/templates/catalogue/main_page.html @@ -253,7 +253,7 @@

Aktualności

{% cache 1800 latest-blog-posts %} - {% latest_blog_posts "http://www.nowoczesnapolska.org.pl/feed/?s=Wolne%20Lektury" %} + {% latest_blog_posts "http://www.nowoczesnapolska.org.pl/tematy/wolne-lektury/feed/" %} {% endcache %}

Zobacz nasz blog ⇒

-- 2.20.1