title: How can I determine if instance of class from Django model is subclass of another model?
body: <p>I have a class called <code>BankAccount</code> as base class. I also have <code>CheckingAccount</code> and <code>SavingsAccount</code> classes that inherit from <code>BankAccount</code>.</p>
  
  <p>BankAccount is not an abstract class but I do not create an object from it, only the inheriting classes.</p>
  
  <p>Then, I execute a query like this:</p>
  
  <pre><code>account = BankAccount.objects.get(id=10)
  </code></pre>
  
  <p>How do I know if account is <code>CheckingAccount</code> or <code>SavingsAccount</code>?</p>
  
  <p>The way I do this now is in this way:</p>
  
  <pre><code>checking_account = CheckingAccount.objects.get(id=account.id)
  </code></pre>
  
  <p>If it exists, it is a <code>CheckingAccount</code>, otherwise, it is a <code>SavingsAccount</code>.</p>