title: Why does django's `apps.get_model()` return a `__fake__.MyModel` object
body: <p>I am writing a custom Django migration script. As per the <a href="https://docs.djangoproject.com/en/3.0/howto/writing-migrations/" rel="noreferrer">django docs on custom migrations</a>, I should be able to use my model vis-a-vis <code>apps.get_model()</code>. However, when trying to do this I get the following error:</p>
  
  <pre><code>AttributeError: type object 'MyModel' has no attribute 'objects'
  </code></pre>
  
  <p>I think this has to do with the apps registry not being ready, but I am not sure.</p>
  
  <p>Sample code:</p>
  
  <pre><code>def do_thing(apps, schema_editor):
      my_model = apps.get_model('app', 'MyModel')
  
      objects_ = my_model.objects.filter(
          some_field__isnull=True).prefetch_related(
          'some_field__some_other_field')  # exc raised here
  
  
  class Migration(migrations.Migration):
  
      atomic = False
  
      dependencies = [
          ('app', '00xx_auto_xxx')
      ]
  
      operations = [
          migrations.RunPython(do_thing),
      ]
  </code></pre>
  
  <p>A simple print statement of <code>apps.get_model()</code>'s return value shows the following:
  <code>&lt;class '__fake__.MyModel'&gt;</code>. I'm not sure what this is, and if it is a result of not being ready.</p>
  
  <p>EDIT:</p>
  
  <p>I couldn't find any resources to explain why I am getting a <code>__fake__</code> object so I decided to tinker with the code. I got it to work by preempting <code>apps</code> from args, as can be seen here:</p>
  
  <pre><code>def do_thing(apps, schema_editor):
      from django.apps import apps
  
      my_model = apps.get_model('app', 'MyModel')
  
      objects_ = my_model.objects.filter(
          some_field__isnull=True).prefetch_related(
          'some_field__some_other_field')  # no more exc raised here
  </code></pre>
  
  <p>I am still confused and any help would be appreciated.</p>