title: django data migration - class variable unavailable via get_model()
body: <p>I'm trying to update some database records via a Django data migration, using the following migration file:</p>
  <pre><code>from django.apps import apps
  from django.db import IntegrityError, migrations
  
  def exclude_pending_drivers(apps, schema_edition):
      Driver = apps.get_model(&quot;team&quot;, &quot;Driver&quot;)
      pending_drivers = Driver.objects.filter(type=Driver.PENDING)
      for driver in pending_drivers:
          driver.show_in_app = False
      Driver.objects.bulk_update(pending_drivers, ['show_in_app'])
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('team', '0002_add_show_in_app_to_driver'),
      ]
  
      operations = [
          migrations.RunPython(exclude_pending_drivers),
      ]
  </code></pre>
  <p>I'm getting an error when I run it:</p>
  <pre><code>AttributeError: type object 'Driver' has no attribute 'PENDING'
  </code></pre>
  <p><code>PENDING</code> is defined as a class variable in the model:</p>
  <pre><code>class Driver(models.Model):
      PENDING = 1
      CONFIRMED = 2
  
      show_in_app = models.BooleanField(default=True)
      # etc
  </code></pre>
  <p>I can run the exact migration code above in a <code>manage.py shell</code> without errors, and it also runs fine if I use <code>from team.models import Driver</code> instead of <code>apps.get_model(&quot;team&quot;, &quot;Driver&quot;)</code> (although obviously that's not advised).</p>
  <p>What gives? It looks like the Driver class, when it's included via <code>apps.get_model()</code>, is different to a straight <code>import</code>, but surely that's not the case??</p>