better native_json naming convention

This commit is contained in:
mdipierro
2014-09-12 20:28:46 -05:00
parent 94a0b1aec5
commit d29a108ad7
3 changed files with 13 additions and 10 deletions
+6 -2
View File
@@ -372,14 +372,18 @@ class IS_JSON(Validator):
if self.native_json:
simplejson.loads(value) # raises error in case of malformed json
return (value, None) # the serialized value is not passed
return (simplejson.loads(value), None)
else:
return (simplejson.loads(value), None)
except JSONErrors:
return (value, translate(self.error_message))
def formatter(self,value):
if value is None:
return None
return simplejson.dumps(value)
if self.native_json:
return value
else:
return simplejson.dumps(value)
class IS_IN_SET(Validator):