django-extensions/django-extensions — Issue #177: shell_plus fails to import models in a subpackage
Author: gwrtheyrn
Created: 2012-02-22 15:59:01+00:00
State: open

I just moved all models in one of several apps in my project into a subpackage.

apps/
app1/
models.py
...
app2/
models/
__init__.py
foo.py
bar.py
...

I imported the models in my `models/__init__.py`:

from .foo import *
from .bar import *

...and that seems to work so far. But shell_plus does not load them automagically.

I don't have `app_label` set inside the model definitions. Importing the models (`from apps.app2.models import FooModelClass`) works.

I found that `get_models(app)` does not return any models, but `get_models()` without an argument returns a list that includes my app2 model classes.