this is my model and i'm using postgresql:
class TripRequest(models.Model):
...
passenger = models.ForeignKey('user.Passenger', on_delete=models.DO_NOTHING)
beginning_point = models.PointField()
beginning_locality = models.CharField(max_length=50, null=True)
destination_point = models.PointField()
destination_locality = models.CharField(max_length=50, null=True)
...
how can i group all records that have matching beginning_locality
and matching destination_locality
?