<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_relationships(self, status, symmetrical=False):
 """ Returns a QuerySet of user objects with which the given user has established a relationship. """

        query = self._get_from_query(status)

        if symmetrical:
            query.update(self._get_to_query(status))

        return User.objects.filter(**query)