Fix in arrayfield

This commit is contained in:
Antonio de la Rosa 2016-05-19 05:14:31 +02:00
parent 05bb9a2082
commit 31d693756f

View file

@ -26,6 +26,7 @@ class ArrayField(PhangoField):
self.error=True self.error=True
self.txt_error='Sorry, the json array is invalid' self.txt_error='Sorry, the json array is invalid'
if type(self.field_type).__name__!='ArrayField':
for k,v in enumerate(value): for k,v in enumerate(value):
value[k]=self.field_type.check(v) value[k]=self.field_type.check(v)
@ -44,3 +45,11 @@ class ArrayField(PhangoField):
return ", ".join(value) return ", ".join(value)
def loads(self, value):
try:
return json.loads(value)
except:
return False