title: Django: foreign key queries
body: <p>I'm learning Django and trying to get the hang of querying foreign keys across a bridging table. Apologies if this is a duplicate, I haven't been able to find the answer by searching. I've got models defined as follows</p>
  
  <pre><code>class Place(models.Model):
      id = models.IntegerField(primary_key=True)
      name = models.CharField(max_length=100)
  class PlaceRef(models.Model):
      place = models.ForeignKey(Place) # many-to-one field
      entry = models.ForeignKey(Entry) # many-to-one field
  class Entry(models.Model):
      id = models.IntegerField(primary_key=True)
      name =  models.CharField(max_length=10)
  </code></pre>
  
  <p>If I want to retrieve all the Entries associated with a particular Place, how do I do it?</p>
  
  <pre><code>place = get_object_or_404(Place, id=id)
  placerefs = PlaceRef.objects.filter(place=place)
  entries = Entry.objects.filter(id.....)
  </code></pre>
  
  <p>Also, if there is a more sensible way for me to define (or get rid of) PlaceRefs in Django, please feel free to suggest alternatives. </p>
  
  <p>Thanks for helping out a beginner!</p>