def METHOD_NAME(self, record, *, headers):
    """Given an object and the desired CSV headers, yield the serialized values for each header."""
    for key in headers:
        # Retrieve the base value corresponding to this key
        if key.startswith("cf_"):
            # Custom field
            value = record.get("custom_fields", {}).get(key[3:], None)
        else:
            value = record.get(key)
        # Coerce the value to a format to make the CSV renderer happy (i.e. a string or number)
        if value is None:
            # Unfortunately we're going to have to be a bit lossy here, as CSV doesn't have a distinction between
            # a null value and an empty string value for a column.
            # We could choose to represent a null value as "None" or "null" but those are also valid strings, so...
            # See corresponding logic in NautobotCSVParser.
            value = ""
        elif isinstance(value, dict):
            if "composite_key" in value:
                # A nested related object
                if value.get("generic_foreign_key"):
                    # A *generic* nested related object
                    value = COMPOSITE_KEY_SEPARATOR.join([value["object_type"], value["composite_key"]])
                else:
                    value = value["composite_key"]
            elif "value" in value and "label" in value:
                # An enum type
                value = value["value"]
            else:
                value = json.dumps(value)
        elif isinstance(value, (list, tuple, set)):
            if isinstance(value, set):
                value = sorted(value)
            if value and isinstance(value[0], dict) and "composite_key" in value[0]:
                # Multiple nested related objects
                if value[0].get("generic_foreign_key"):
                    # Multiple *generic* nested related obects
                    value = [COMPOSITE_KEY_SEPARATOR.join([v["object_type"], v["composite_key"]]) for v in value]
                else:
                    value = [v["composite_key"] for v in value]
            # The below makes for better UX than `json.dump()` for most current cases.
            value = ",".join([str(v) if v is not None else "" for v in value])
        elif not isinstance(value, (str, int)):
            value = str(value)
        if settings.DEBUG:
            logger.debug("key: %s, value: %s", key, value)
        yield value