title: Django queryset exclude values
body: <p>models.py</p>
  
  <pre><code>class ChatMessage(models.Model):
      ip=models.IPAddressField()
      message=models.CharField(max_length=200)
  
  class BlockIp(models.Model):
      ip=models.IPAddressField()
  </code></pre>
  
  <p>admin.py</p>
  
  <pre><code>class ChatMessageAdmin(admin.ModelAdmin):
      def queryset(self, request):
          qs = super(ChatMessageAdmin, self).queryset(request)
          #block=BlockIp.objects.all()
          return qs.exclude(ip='1.1.1.1')
  </code></pre>
  
  <p>I have rewrite the queryset method for ChatMessage class.
  I am trying to return something like:</p>
  
  <pre><code>SELECT * FROM chatmessage as v1 JOIN blockip as v2 on v1.ip!=v2.ip
  </code></pre>
  
  <p>so the user see only the messages which have an ip which is not in a blockip entry</p>
  
  <p><code>return qs.exclude(ip=BlockIp.objects.all().ip)</code> is not syntax correct :(</p>
  
  <p>Any advice?</p>