You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
555 B
16 lines
555 B
from django.core.management.base import BaseCommand
|
|
from IPython.terminal.embed import InteractiveShellEmbed
|
|
from django.db.models import Model
|
|
|
|
|
|
class Command(BaseCommand):
|
|
def handle(self, *args, **options):
|
|
modules = ('specializations.models', )
|
|
for module in modules:
|
|
m = __import__(module, fromlist='non-empty')
|
|
for a in m.__dict__:
|
|
v = getattr(m, a)
|
|
if hasattr(v, '__base__') and issubclass(v, Model):
|
|
globals()[a] = v
|
|
|
|
InteractiveShellEmbed()() |