i want to filter the database like this .
qs = profile.objects.filter().select_related('profile_detail').select_related('location')
But here location is a foreignkey in profile_detail model. So how can i do that query
class Location(models.Model):
place = models.CharField(max_length=128)
class ProfileDetail(models.Model):
location = models.ForiegnKey(Location)
class Profile(models.Model):
detail = models.ForeignKey(ProfileDetail)