<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_connection(self, from_obj, to_obj):
 """ Creates and returns a connection between the given objects. If a connection already exists, that connection will be returned instead. """

        self._validate_ctypes(from_obj, to_obj)
        return Connection.objects.get_or_create(relationship_name=self.name,
                                                from_pk=from_obj.pk, to_pk=to_obj.pk)[0]