mirror of
https://github.com/django/django.git
synced 2025-06-05 11:39:13 +00:00
Added workaround for loading duplicate model classes in management shell. Patch
from Curtis Thompson and Benjamin Slavin. Refs #1796. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
440d318d86
commit
892202b319
@ -1174,6 +1174,11 @@ createcachetable.args = "[tablename]"
|
|||||||
|
|
||||||
def run_shell(use_plain=False):
|
def run_shell(use_plain=False):
|
||||||
"Runs a Python interactive interpreter. Tries to use IPython, if it's available."
|
"Runs a Python interactive interpreter. Tries to use IPython, if it's available."
|
||||||
|
# XXX: (Temporary) workaround for ticket #1796: force early loading of all
|
||||||
|
# models from installed apps.
|
||||||
|
from django.db.models.loading import get_models
|
||||||
|
loaded_models = get_models()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if use_plain:
|
if use_plain:
|
||||||
# Don't bother loading IPython, because the user wants plain Python.
|
# Don't bother loading IPython, because the user wants plain Python.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user