title: Django per-object permissions
body: <p>I have users that each are associated with a list of real estate properties they are allowed to access. Multiple users may have permission to view the same site.</p>
  
  <p>How would I set this up in django?</p>
  
  <p>I have the:</p>
  
  <pre><code>class UserProfile(models.Model):
      user = models.OneToOneField(User)
      last_session_time_online = models.IntegerField()
      total_time_online = models.IntegerField()
      def __unicode__(self):
          return self.user
  </code></pre>
  
  <p>and the </p>
  
  <pre><code>class Site(models.Model):
      site_name = models.CharField(max_length = 512)
      ...Other stuff...
      def __unicode__(self):
          return self.user
  </code></pre>