title: Trying to restrict items to a specific user in a Django Class Based View query set
body: <p>I have the following models:</p>
  <pre><code>class AccountManager(models.Model):
      account_manager = models.ForeignKey(
        settings.AUTH_USER_MODEL, 
        on_delete=models.CASCADE
      )
  
      def __str__(self):
          return str(self.account_manager)
  
  class Client(models.Model):
      account_manager = models.ForeignKey(AccountManager, on_delete=models.CASCADE, related_name='account_manager_clients')
      client = models.CharField(max_length=255)
  
      def __str__(self):
          return self.client
  
  class Contract(models.Model):
      client = models.ForeignKey(Client, on_delete=models.CASCADE, related_name='client_contracts')
      site_name = models.CharField(max_length=255)
  
      def __str__(self):
          return self.site_name
  </code></pre>
  <p>I can restrict the clients to the specific account managers by using the following view</p>
  <pre><code>class ClientListView(LoginRequiredMixin, ListView):
      model = Client
      template_name = &quot;clients/list.html&quot;
  
      def get_queryset(self, *args, **kwargs):
          return (
              super()
              .get_queryset(*args, **kwargs)
              .filter(account_manager__account_manager=self.request.user)
          )
  </code></pre>
  <p>However I can't seem to restrict the contracts to the account manager with the following view:</p>
  <pre><code>class AMContractDetailView(LoginRequiredMixin, DetailView):
      model = Contract
      template_name = 'contracts/am_contract_detail.html'
  
      def get_queryset(self, *args, **kwargs):
          return (
              super()
              .get_queryset(*args, **kwargs)
              .filter(client__account_manager=self.request.user.id)
          )
  </code></pre>
  <p>This allows account managers to see all the clients not just their own.
  I know I am doing something fundamentally wrong but have got a bit lost!</p>
  <p>Any help would be appreciated.</p>