maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH] Force bounding box values to 0 when the field s


From: Maxime Petazzoni
Subject: [Maposmatic-dev] [PATCH] Force bounding box values to 0 when the field says NaN
Date: Wed, 9 Sep 2009 13:14:14 +0200

---
 www/maposmatic/widgets.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/www/maposmatic/widgets.py b/www/maposmatic/widgets.py
index ff0d4fe..4ccf59d 100644
--- a/www/maposmatic/widgets.py
+++ b/www/maposmatic/widgets.py
@@ -32,7 +32,10 @@ URL_OSM_JS = ["http://www.openlayers.org/api/OpenLayers.js";,
 
 class PointField(forms.FloatField):
     """A non-GIS dependant point field."""
-    pass
+
+    def clean(self, value):
+        if value == 'NaN':
+            return 0
 
 if settings.has_gis_database():
     from django.contrib.gis.db import models
-- 
1.6.3.3.210.g29cb3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]