def add_serializer_errors(serializer, data, field_errors):
 if (not serializer.is_valid()):
  errors = serializer.errors
  for (key, error) in errors.iteritems():
   field_errors[key] = {'developer_message': u"Value '{field_value}' is not valid for field '{field_name}': {error}".format(field_value=data.get(key, ''), field_name=key, error=error), 'user_message': _(u'This value is invalid.')}
 return field_errors

def add_serializer_errors ( serializer , data , field_errors ) : if ( not serializer . is_valid ( ) ) : errors = serializer . errors for ( key , error ) in errors . iteritems ( ) : field_errors [ key ] = { 'developer_message' : u"Value '{field_value}' is not valid for field '{field_name}': {error}" . format ( field_value = data . get ( key , '' ) , field_name = key , error = error ) , 'user_message' : _ ( u'This value is invalid.' ) } return field_errors
adds errors from serializer validation to field_errors .