Author: mtredinnick
Date: 2007-02-16 19:38:03 -0600 (Fri, 16 Feb 2007)
New Revision: 4533

Modified:
   django/trunk/django/core/management.py
Log:
Added workaround for loading duplicate model classes in management shell. Patch
from Curtis Thompson and Benjamin Slavin. Refs #1796.


Modified: django/trunk/django/core/management.py
===================================================================
--- django/trunk/django/core/management.py      2007-02-17 01:29:34 UTC (rev 
4532)
+++ django/trunk/django/core/management.py      2007-02-17 01:38:03 UTC (rev 
4533)
@@ -1174,6 +1174,11 @@
 
 def run_shell(use_plain=False):
     "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:
         if use_plain:
             # Don't bother loading IPython, because the user wants plain 
Python.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to