from django.db.models import Q
criterion1 = Q(UID=request.user.id) #any query you want
criterion2 = Q(FID=user.id) #any query you want
criterion3 = Q(FID=request.user.id) #any query you want
criterion4 = Q(UID=user.id) #any query you want
areTheyFriends = Friends.objects.filter(criterion1 & criterion2 | criterion3 & criterion4) # use `&` and `|` logical operators
from django.db.models import Q
ticket_query = request.event.tickets.filter(Q(status='on-sale') | Q(status='paused')).prefetch_related('ticket_tax')