summaryrefslogtreecommitdiff
path: root/django/db/models/loading.py
AgeCommit message (Collapse)Author
2010-04-15Fixed #13348: Restored ability to load models from apps in eggs. Thanks ↵Karen Tracey
Ramiro and metzen for pointers on how to find out if a module loaded from an egg has a particular submodule. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12982 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-14Fixed #13335: Adjusted the r12950 fix to properly handle import errors ↵Karen Tracey
resulting from nested calls to load_app. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12972 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-12Fixed #11696: Changed app loading code so that it does not swallow import ↵Karen Tracey
errors that used to be (prior to r10088) raised. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-10Changed a whole bunch of places to raise exception instances instead of ↵Adrian Holovaty
old-style raising exception classes plus a comma. Good for the future Python 3 conversion git-svn-id: http://code.djangoproject.com/svn/django/trunk@12180 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #11936 -- Removed deferred models from the list returned by the ↵Russell Keith-Magee
app_cache. Thanks to ryszard for the report, and clamothe for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11938 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-16Fixed #12389 - performance enhancement of get_models()Luke Plant
Thanks to Travis Cline for the patch, which gives about 35% speed increase for the testsuite (with SQLite in-memory DB). git-svn-id: http://code.djangoproject.com/svn/django/trunk@11883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-03Fixed #10109 -- Removed the use of raw SQL in many-to-many fields by ↵Russell Keith-Magee
introducing an autogenerated through model. This is the first part of Alex Gaynor's GSoC project to add Multi-db support to Django. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11710 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18Fixed #8193: all dynamic imports in Django are now done correctly. I know ↵Jacob Kaplan-Moss
this because Brett Cannon borrowed the time machine and brought Python 2.7's '`importlib` back for inclusion in Django. Thanks for the patch-from-the-future, Brett! git-svn-id: http://code.djangoproject.com/svn/django/trunk@10088 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-21Added tests for corner case with deleting where objects are deleted in the ↵Luke Plant
wrong order. These tests currently fail, by design, fix will be committed shortly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-17Fixed #7044 -- Corrected a minor typo in a docstring in the model loader. ↵Russell Keith-Magee
Thanks, msaelices. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-10Removed code that was recasting major errors found during application ↵Russell Keith-Magee
import. If an application can't be imported, it now throws a full stack trace with the problem, rather than reporting the problem as a one line message. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-18Renamed Cache to AppCache and cache_ready() to app_cache_ready() from [5919] ↵Malcolm Tredinnick
in order to avoid any potential confusion with Django's caching middleware functionality when reading the code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17Rewrote portions of the app- and model-cache initialisation to handle some ↵Malcolm Tredinnick
corner cases. It is now possible to use m2m relations before everything is imported and still get the right results later when importing is complete. Also, get_apps() should always return the same results, so apps won't randomly disappear in the admin interface. Also reorganised the structure of loading.py, since the number of global variables was exploding. The public API is still backwards compatible. Fixed #1796 and #2438 (he claims, optimistically). git-svn-id: http://code.djangoproject.com/svn/django/trunk@5919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-26Fixed #4040 -- Changed uses of has_key() to "in". Slight performanceMalcolm Tredinnick
improvement and forward-compatible with future Python releases. Patch from Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-30Fixed #2968 -- Changed arguments to __import__ to use empty dictionary ↵Adrian Holovaty
instead of empty string, for stricter compliance with Python library reference. Thanks for the patch, Yasushi Masuda git-svn-id: http://code.djangoproject.com/svn/django/trunk@3951 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-08Negligible style change in django.db.models.loadingAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-07-29Seed the global app cache in a call to db.models.get_model() except when we areMalcolm Tredinnick
constructing a model class. Refs #2348. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-30Negligible spacing change to django/db/models/loading.pyAdrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3243 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-28Fixed #1812 -- permit apps without models (without disguising other errors).Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-26Fixed another path where imports were creating two instances of a model'sMalcolm Tredinnick
class. Refs #1796, #2232. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-26Fixed #1796 -- implemented more robust normalisation for module filenamesMalcolm Tredinnick
before comparing them. Ivan Saglaev found a case where r3202 did not work properly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-25Fixed #1796 -- only load a single copy of each model, even when it isMalcolm Tredinnick
referenced via different import paths. Solves a problem with many-to-many relations being set up incorrectly. Thanks to Curtis Thompson, Luke Plant and Simon Willison for some excellent debugging of the problem. Refs #2232 (may also have fixed that). git-svn-id: http://code.djangoproject.com/svn/django/trunk@3202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-25Fixes #1812 -- Added model validity checks to ensure that models.py exists, ↵Russell Keith-Magee
and has been successfully imported for all INSTALLED_APPS. Previous behaviour was to silently ignore empty/problem models, which resulted in the display of an admin page that doesn't display a supposedly installed model. Thanks to Ian Holsman for the original report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-23Fixed #1662 -- Added resolver for string-form model references for models ↵Russell Keith-Magee
that have already been loaded, with tests to validate both forward and backward referenced model names. Light refactoring of model loading to make regression tests behave more like normal model loading. Also clarifies the text of some validation errors. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-26Fixed #1732 -- AttributeErrors in models are no longer ignored by the model ↵Adrian Holovaty
validator. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-05-02MERGED MAGIC-REMOVAL BRANCH TO TRUNK. This change is highly ↵Adrian Holovaty
backwards-incompatible. Please read http://code.djangoproject.com/wiki/RemovingTheMagic for upgrade instructions. git-svn-id: http://code.djangoproject.com/svn/django/trunk@2809 bcc190cf-cafb-0310-a4f2-bffc1f526a37