First working version of filter_area in HistoryForm
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:18:29 +0000 (10:18 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:18:29 +0000 (10:18 +0000)
bin/djais/views.py

index c6258317dee74bb207044a55ed84e4201975d2b3..bc59cfddc066d0711ccd469dc8bd3dcfd6ec02dd 100644 (file)
@@ -171,7 +171,7 @@ class HistoryForm(forms.Form):
     duration = SecondsField(required=False, label='Period length', initial=7*86400)
     end_date = forms.DateTimeField(required=False, widget=AisCalendarWidget(attrs={'class':'vDateField'}))
     grain = SecondsField(label='One position every', initial=3600)
-    filter_area = forms.ChoiceField(required=False, label='Only in area (not implemented)',
+    filter_area = forms.ChoiceField(required=False, label='Only in area',
         choices=[ (u'', u'(Not filtered)') ] + [ (fn[1], fn[0]) for fn in list_areas() ] )
 
     def clean_start_date(self):
@@ -247,9 +247,7 @@ class HistoryForm(forms.Form):
 
         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'\''
+            command += u' --filter-area \'' + filter_area + u'\''
 
         return command, extension