Django

Code

Ticket #1796: new_management.patch

File new_management.patch, 0.7 kB (added by Benjamin Slavin, 2 years ago)

Patch updated so it can be applied from the root SVN directory.

  • django/core/management.py

    old new  
    11741174 
    11751175def run_shell(use_plain=False): 
    11761176    "Runs a Python interactive interpreter. Tries to use IPython, if it's available." 
     1177    # Force loading all the models in the installed apps. Otherwise, we 
     1178    # can get into some weird problems where many_to_many relations fail because 
     1179    # field options differ (perhaps due to permisions): 
     1180    from django.db.models.loading import get_models 
     1181    loaded_models = get_models() 
     1182 
    11771183    try: 
    11781184        if use_plain: 
    11791185            # Don't bother loading IPython, because the user wants plain Python.