title: How follow a relationship backward from a M2O to O2O?
body: <p>The <code>UserProfile</code> has a one-to-one to 'User' and a many-to-one to <code>Place</code></p>
  
  <pre><code>class UserProfile( models.Model ) :
      user  = models.OneToOneField( User )
      place = models.ForeignKey( Place, null = True, blank = True )
  </code></pre>
  
  <p>In my the detail view of <code>Place</code>, I want to list all the <em>residents</em> for that <code>Place</code>. In other words, I want to list all <code>User</code>s, whose <code>UserProfile</code> had the specified <code>Place</code>.</p>
  
  <p>In my template, I tried</p>
  
  <pre><code>{% for resident in place.user_profile_set.user_set.all %}
  </code></pre>
  
  <p>But that didn't work. I guess I am missing something fundamentally in Django's concept of <a href="https://docs.djangoproject.com/en/1.4/topics/db/queries/#following-relationships-backward" rel="nofollow">"following a relationship backwards"</a>?</p>