Changed DictValidator so that long and int datatypes are not treated as different...
[philipp/winterrodeln/wrpylib.git] / wrpylib / wrvalidators.py
index 7d8b67023ace36d8418d9217c4119c464613413d..416e5d0d2cfd76f68ce0e58661ba238562b3f2be 100644 (file)
@@ -149,7 +149,8 @@ class DictValidator(formencode.FancyValidator):
     
     def from_python(self, value):
         for k, v in self.dict.iteritems():
     
     def from_python(self, value):
         for k, v in self.dict.iteritems():
-            if type(v) == type(value) and v == value: return k
+            if v == value:
+                return k
         raise formencode.Invalid('Invalid value', value, None)
 
 
         raise formencode.Invalid('Invalid value', value, None)