def get_error_detail(exc_info):
 code = (getattr(exc_info, u'code', None) or u'invalid')
 return [ErrorDetail(msg, code=code) for msg in exc_info.messages]

def get_error_detail ( exc_info ) : code = ( getattr ( exc_info , u'code' , None ) or u'invalid' ) return [ ErrorDetail ( msg , code = code ) for msg in exc_info . messages ]
given a django validationerror .