From 2403874fe07a21d8a4f630d838944160fb740ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20Utard?= Date: Fri, 6 Aug 2010 19:07:20 +0200 Subject: [PATCH] Add geographic references of maps to RSS feed (GeoRSS). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, this works only for bounding boxes, not for administrative boundaries. Signed-off-by: Gaƫl Utard Signed-off-by: Maxime Petazzoni --- www/maposmatic/feeds.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/maposmatic/feeds.py b/www/maposmatic/feeds.py index 5f3dc58a..75c73a90 100644 --- a/www/maposmatic/feeds.py +++ b/www/maposmatic/feeds.py @@ -26,7 +26,7 @@ import datetime -from django.contrib.syndication.feeds import Feed +from django.contrib.gis.feeds import Feed from django.utils.translation import ugettext_lazy as _ from www.maposmatic import models @@ -69,3 +69,9 @@ class MapsFeed(Feed): def item_title(self, item): return item.maptitle + def item_geometry(self, item): + if item.administrative_city: + return None + else: + return (item.lon_upper_left, item.lat_upper_left, + item.lon_bottom_right, item.lat_bottom_right)