<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_to_many_relationship_value(self, obj, column):
 """ Get the resulting datas for a One To many or a many to many relationship :param obj obj: The instance we manage :param dict column: The column description dictionnary :returns: The associated value """

        related_key = column.get('related_key', None)

        related = getattr(obj, column['__col__'].key)
        value = {}
        if related:
            total = len(related)
            for index, rel_obj in enumerate(related):
                if related_key:
                    compiled_res = self._get_formatted_val(
                        rel_obj, related_key, column
                    )
                else:
                    compiled_res = column['__prop__'].compile_obj(
                        rel_obj
                    )
                value['item_%d' % index] = compiled_res
                value[str(index)] = compiled_res
                value["_" + str(index)] = compiled_res

                if index == 0:
                    value['first'] = compiled_res

                if index == total - 1:
                    value['last'] = compiled_res

        return value