Fixed area filter
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:00:25 +0000 (10:00 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Sun, 17 Apr 2011 10:00:25 +0000 (10:00 +0000)
bin/djais/views.py

index 0fef29eb8223438c8faafdeac1ac269c8d3b5dd1..8426945693bfd404f2dd15800640e72619a25814 100644 (file)
@@ -25,7 +25,7 @@ from django.utils.safestring import mark_safe
 
 from decoratedstr import remove_decoration
 
-from ais.areas import list_areas
+from ais.area import list_areas
 from ais.djais.basicauth import http_authenticate
 from ais.djais.models import *
 from ais.show_targets_ships import format_fleet, kml_to_kmz
@@ -171,7 +171,8 @@ 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)', choices=list_areas())
+    filter_area = forms.ChoiceField(required=False, label='Only in area (not implemented)',
+        choices=[ (u'', u'(Not filtered)') ] + [ (fn[1], fn[0]) for fn in list_areas() ] )
 
     def clean_start_date(self):
         period_type = self.cleaned_data.get('period_type', None)