title: Django Filter ForeignKey relationships in get_queryset
body: <p>I wonder what to do here.
   So I have an EmailAddress class which has a ForeignKey relationship to my User class</p>
  
  <pre><code>class EmailAddress(models.Model):
  
  user = models.ForeignKey(allauth_app_settings.USER_MODEL, verbose_name=_('user'))
  email = models.EmailField(unique=app_settings.UNIQUE_EMAIL,
                            verbose_name=_('e-mail address')) 
  </code></pre>
  
  <p>I also have a UserProfile class which has a OneToOneField relationship with the mentioned User like so:</p>
  
  <pre><code>class UserProfile(models.Model):
  
  user = models.OneToOneField(User, related_name='profile')
  attribute= models.CharField("attr", max_length=150, blank=False)
  </code></pre>
  
  <p>Now in admin.py I want to filter the Users so that the current user who is logged in to admintool can only see emails from users who share some attribute. The catch is that the attribute is saved in UserProfile and I need to get there through the email. <br></p>
  
  <p>Basically I don't know how to access the 'attribute' which is in the UserProfile. I understand that I want to filter users by taking the email finding the user that this email belongs to and then compare his 'attribute' to the user who send the request to decide whether to show it to him or not.</p>
  
  <pre><code>def get_queryset(self, request):
  user = [User whos email is in the list]
  qs = [the queryset]
  [and then]
  return qs.filter([filter so the user attribute = the request.user attribute])
  </code></pre>
  
  <p>Im using allauth btw. in case you wonder what </p>
  
  <pre><code> allauth_app_settings.USER_Model 
  </code></pre>
  
  <p>stands for.</p>
  
  <p>Have a nice day!</p>