<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _to_fields(self, *values):
 """ Take a list of values, which must be primary keys of the model linked to the related collection, and return a list of related fields. """

        result = []
        for related_instance in values:
            if not isinstance(related_instance, model.RedisModel):
                related_instance = self.related_field._model(related_instance)
            result.append(getattr(related_instance, self.related_field.name))
        return result