code: def resolve_relation_type_config(value):
      
      relation_types = current_app.config['PIDRELATIONS_RELATION_TYPES']
      if isinstance(value, six.string_types):
          try:
              obj = next(rt for rt in relation_types if rt.name == value)
          except StopIteration:
              raise ValueError("Relation name '{0}' is not configured.".format(
                  value))
  
      elif isinstance(value, int):
          try:
              obj = next(rt for rt in relation_types if rt.id == value)
          except StopIteration:
              raise ValueError("Relation ID {0} is not configured.".format(
                  value))
      else:
          raise ValueError("Type of value '{0}' is not supported for resolving.".
                           format(value))
      api_class = obj_or_import_string(obj.api)
      schema_class = obj_or_import_string(obj.schema)
      return obj.__class__(obj.id, obj.name, obj.label, api_class, schema_class)
docs: Resolve the relation type to config object.
  
      Resolve relation type from string (e.g.:  serialization) or int (db value)
      to the full config object.