FIrst implementation of filter_area in HistoryForm
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:06:41 +0000 (10:06 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:06:41 +0000 (10:06 +0000)
bin/djais/views.py

index 8426945693bfd404f2dd15800640e72619a25814..c6258317dee74bb207044a55ed84e4201975d2b3 100644 (file)
@@ -245,6 +245,12 @@ class HistoryForm(forms.Form):
         grain = data['grain']
         command += u' --granularity ' + unicode(grain)
 
+        filter_area = data.get('filter_area', None)
+        if filter_area:
+            for area in list_areas():
+                if filter_area == area[0]:
+                    command += u' --filter-area \'' + area[1] + u'\''
+
         return command, extension