Made ListField validation exceptions more helpful

This commit is contained in:
Harry Marr 2010-03-17 15:10:10 +00:00
parent 5b42578cb1
commit 60802796cb

View File

@ -296,9 +296,8 @@ class ListField(BaseField):
try:
[self.field.validate(item) for item in value]
except:
raise ValidationError('All items in a list field must be of the '
'specified type')
except Exception, err:
raise ValidationError('Invalid ListField item (%s)' % str(err))
def prepare_query_value(self, op, value):
if op in ('set', 'unset'):