title: django: best practice way to get model from an instance of that model
body: <p>Say <code>my_instance</code> is of model <code>MyModel</code>.<br>
  I'm looking for a good way to do:</p>
  
  <pre><code>my_model = get_model_for_instance(my_instance)
  </code></pre>
  
  <p>I have not found any really direct way to do this.
  So far I have come up with this:</p>
  
  <pre><code>from django.db.models import get_model
  
  my_model = get_model(my_instance._meta.app_label, my_instance.__class__.__name__)
  </code></pre>
  
  <p>Is this acceptable? Is it even a sure-fire, best practice way to do it?<br>
  There is also <code>_meta.object_name</code> which seems to deliver the same as <code>__class__.__name__</code>. Does it? Is better or worse? If so, why?</p>
  
  <p>Also, how do I know I'm getting the correct model if the app label occurs multiple times within the scope of the project, e.g. 'auth' from 'django.contrib.auth' and let there also be 'myproject.auth'?<br>
  Would such a case make <code>get_model</code> unreliable?</p>
  
  <p>Thanks for any hints/pointers and sharing of experience!</p>