[damned-lies] Updated rss feeds to django 1.2
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] Updated rss feeds to django 1.2
- Date: Thu, 24 Mar 2011 09:57:46 +0000 (UTC)
commit 23cab83a0fec2191fdc7725d3f9ac9161c1cdc97
Author: Claude Paroz <claude 2xlibre net>
Date: Thu Mar 24 10:57:09 2011 +0100
Updated rss feeds to django 1.2
feeds/urls.py | 11 ++---------
templates/vertimus/vertimus_detail.html | 2 +-
vertimus/feeds.py | 15 +++++----------
3 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/feeds/urls.py b/feeds/urls.py
index 3bd648b..74f563b 100644
--- a/feeds/urls.py
+++ b/feeds/urls.py
@@ -1,14 +1,7 @@
from django.conf.urls.defaults import *
from vertimus.feeds import LatestActionsByLanguage, LatestActionsByTeam
-feeds = {
- 'languages': LatestActionsByLanguage,
- 'teams': LatestActionsByTeam,
-}
-
urlpatterns = patterns('',
- url(
- regex = r'^(?P<url>.*)/$',
- view = 'django.contrib.syndication.views.feed',
- kwargs = {'feed_dict': feeds})
+ (r'^languages/(?P<locale>.*)/$', LatestActionsByLanguage()),
+ (r'^teams/(?P<team_name>.*)/$', LatestActionsByTeam()),
)
diff --git a/templates/vertimus/vertimus_detail.html b/templates/vertimus/vertimus_detail.html
index e3224a5..a73a5a7 100644
--- a/templates/vertimus/vertimus_detail.html
+++ b/templates/vertimus/vertimus_detail.html
@@ -81,7 +81,7 @@ $(document).ready(function() {
</div>
</div>
{% endif %}
- {% if pot_stats.fig_count and stats.language %}
+ {% if pot_stats.full_po.fig_count and stats.language %}
<div class="docimages">
<a href="{% url stats.views.docimages module_name=module.name,potbase=stats.domain.name,branch_name=branch.name,langcode=stats.language.locale %}">
<img src="{{ MEDIA_URL }}img/figure.png" alt="{% trans "Display document figures" %}"></a>
diff --git a/vertimus/feeds.py b/vertimus/feeds.py
index cbcea46..7015a24 100644
--- a/vertimus/feeds.py
+++ b/vertimus/feeds.py
@@ -20,8 +20,7 @@
from itertools import islice
from django.core import urlresolvers
-from django.core.exceptions import ObjectDoesNotExist
-from django.contrib.syndication.feeds import Feed, FeedDoesNotExist
+from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import Site
from languages.models import Language
@@ -33,10 +32,8 @@ class LatestActionsByLanguage(Feed):
title_template = 'feeds/actions_title.html'
description_template = 'feeds/actions_description.html'
- def get_object(self, bits):
- if len(bits) != 1:
- raise ObjectDoesNotExist
- return Language.objects.get(locale=bits[0])
+ def get_object(self, request, locale):
+ return Language.objects.get(locale=locale)
def title(self, obj):
current_site = Site.objects.get_current()
@@ -79,10 +76,8 @@ class LatestActionsByTeam(Feed):
title_template = 'feeds/actions_title.html'
description_template = 'feeds/actions_description.html'
- def get_object(self, bits):
- if len(bits) != 1:
- raise ObjectDoesNotExist
- return Team.objects.get(name=bits[0])
+ def get_object(self, request, team_name):
+ return Team.objects.get(name=team_name)
def title(self, obj):
current_site = Site.objects.get_current()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]