From da21072e19aff8a02c981b0d331996338bec99c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 21 Mar 2013 09:52:09 +0100 Subject: [PATCH] weather: add proper support for locations (#2606) --- univcloud/apps/weather.py | 10 ++++++++++ univcloud/templates/apps/add.html | 16 ++++++++++++++-- univcloud/templates/apps/weather.html | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/univcloud/apps/weather.py b/univcloud/apps/weather.py index 31bafdc..680ee4c 100644 --- a/univcloud/apps/weather.py +++ b/univcloud/apps/weather.py @@ -24,3 +24,13 @@ class App(BaseApp): '''Weather App, used to display the current weather''' app_id = 'weather-app' template_name = 'apps/weather.html' + location = None + + def __init__(self, app_id, location='615702', **kwargs): + super(App, self).__init__(app_id, **kwargs) + self.location = location + + def get_content_args(self): + args = super(App, self).get_content_args() + args.update({'location': self.location}) + return args diff --git a/univcloud/templates/apps/add.html b/univcloud/templates/apps/add.html index f3c0a4a..66bb3a9 100644 --- a/univcloud/templates/apps/add.html +++ b/univcloud/templates/apps/add.html @@ -28,13 +28,25 @@ Nouvelle applicationĀ :
- +