def serialize_value(field_type, value):
 try:
  return app.data.serializers[field_type](value)
 except (KeyError, ValueError, TypeError, InvalidId):
  return value

def serialize_value ( field_type , value ) : try : return app . data . serializers [ field_type ] ( value ) except ( KeyError , ValueError , TypeError , InvalidId ) : return value
serialize value of a given type .