title: Django best way to check the model type of a queryset
body: <p>I have a Django action function which I would like to use on querysets based on different models.</p>
  
  <p>What is the best way to check the model type my queryset is composed of? Say I want to check for a Library class that is defined in my models.py</p>
  
  <p>At the moment I can get it to work using </p>
  
  <pre><code>for object in queryset :
      if object.__class__.__name__  == "Library"
  </code></pre>
  
  <p>But I am sure there is a better way of doing this. </p>
  
  <p>I assume somehow I do something using queryset.model. 
  I have tried the following, but it doesn't do what I want it to:</p>
  
  <pre><code>import myapp.models.Library
  
  def my function(modeladmin,request  queryset )
  
      if isinstance(queryset.model , Library ) :
          # do something specific here
  </code></pre>