title: How to filter queryset in changelist_view in django admin?
body: <p>Let's say I have a site where Users can add Entries through admin panel. Each User has his own Category he is responsible for (each Category has an Editor assigned through ForeingKey/ManyToManyField).</p>
  
  <p>When User adds Entry, I limit the choices by using EntryAdmin like this:</p>
  
  <pre><code>class EntryAdmin(admin.ModelAdmin):
      (...)
  
      def formfield_for_foreignkey(self, db_field, request, **kwargs):
          if db_field.name == 'category':
              if request.user.is_superuser:
                  kwargs['queryset'] = Category.objects.all()
              else:
                  kwargs['queryset'] = Category.objects.filter(editors=request.user)
              return db_field.formfield(**kwargs)
          return super(EntryAdmin, self).formfield_for_foreignkey(db_field, request, **kwargs)
  </code></pre>
  
  <p>This way I can limit the categories to which a User can add Entry and it works perfect.</p>
  
  <p>Now the tricky part: On the Entry changelist/action page I want to show only those Entries which belong to current User's Category. I tried to do this using this method:</p>
  
  <pre><code>    def changelist_view(self, request, extra_context=None):
          if not request.user.is_superuser:
              self.queryset = self.queryset.filter(editors=request.user)
  </code></pre>
  
  <p>But I get this error:</p>
  
  <blockquote>
    <p>AttributeError: 'function' object has no attribute 'filter'</p>
  </blockquote>
  
  <p>This is strange, because I thought it should be a typical QuerySet. Basically such methods are <a href="http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.changelist_view" rel="noreferrer">not well documented</a> and digging through tons of Django code is not my favourite sport.</p>
  
  <p>Any ideas how can I achieve my goal?</p>