summaryrefslogtreecommitdiff
path: root/django/apps/base.py
AgeCommit message (Collapse)Author
2014-01-26Fixed #21877 -- Renamed django.apps.base to config.Aymeric Augustin
2014-01-25Fixed #17304 -- Allow single-path and configured-path namespace packages as ↵Carl Meyer
apps. Also document the conditions under which a namespace package may or may not be a Django app, and raise a clearer error message in those cases where it may not be. Thanks Aymeric for review and consultation.
2014-01-25Fixed #21829 -- Added default AppConfigs.Aymeric Augustin
Thanks Russell for the report, Marc for the initial patch, Carl for the final review, and everyone who contributed to the design discussion.
2014-01-15Fixed typo in comment.Martin Matusiak
2013-12-31Renamed AppConfig.setup to ready.Aymeric Augustin
Thanks Jannis and Marc for the feedback. Fixed #21717.
2013-12-30Merged Apps.populate_apps() and populate_models().Aymeric Augustin
After the recent series of refactorings, there's no reason to keep two distinct methods. Refs #21681.
2013-12-30Stopped populating the app registry as a side effect.Aymeric Augustin
Since it triggers imports, it shouldn't be done lightly. This commit adds a public API for doing it explicitly, django.setup(), and does it automatically when using manage.py and wsgi.py.
2013-12-30Added AppConfig.setup() to run setup code.Aymeric Augustin
2013-12-29Added AppConfig.get_models().Aymeric Augustin
2013-12-28Simplified Apps.get_model and added AppConfig.get_model.Aymeric Augustin
Documented them as public APIs.
2013-12-28Populated non-master app registries.Aymeric Augustin
This removes the gap between the master app registry and ad-hoc app registries created by the migration framework, specifically in terms of behavior of the get_model[s] methods. This commit contains a stealth feature that I'd rather not describe.
2013-12-27Avoided %r formatting on possibly unicode strings.Aymeric Augustin
The u prefix looks bad on Python 2.
2013-12-26Normalized exceptions raised by AppConfig.create.Aymeric Augustin
It raises ImportError whenever an entry in INSTALLED_APPS points (directly or indirectly via AppConfig.name) to a non-existing module and ImproperlyConfigured in all other cases. Catching ImportError and re-raising ImproperlyConfigured tends to make circular imports more difficult to diagnose.
2013-12-26Made the AppConfig API marginally more consistent.Aymeric Augustin
Eliminated the app_ prefix that was more confusing than useful.
2013-12-26Beefed up the comments for AppConfig.all_models.Aymeric Augustin
2013-12-24Renamed AppCache to Apps.Aymeric Augustin
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Made it possible to create apps without a models module.Aymeric Augustin
This commit reverts f44c4a5d0f and 39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
2013-12-17Simplified register_models.Aymeric Augustin
Since it's never called with more than one model at a time the current signature is needlessly complicated.
2013-12-17Fleshed out AppConfig objects.Aymeric Augustin
Marginally improved creation of AppConfig stubs for non-installed apps.
2013-12-17Moved list of models inside AppConfig instances.Aymeric Augustin
This commit is a refactoring with no change of functionality, according to the following invariants: - An app_label that was in app_configs and app_models stays in app_config and has its 'installed' attribute set to True. - An app_label that was in app_models but not in app_configs is added to app_configs and has its 'installed' attribute set to True. As a consequence, all the code that iterated on app_configs is modified to check for the 'installed' attribute. Code that iterated on app_models is rewritten in terms of app_configs. Many tests that stored and restored the state of the app cache were updated. In the long term, we should reconsider the usefulness of allowing importing models from non-installed applications. This doesn't sound particularly useful, can be a trap in some circumstances, and causes significant complexity in sensitive areas of Django.
2013-12-17Stored AppConfig objects instead of models modules in the app cache.Aymeric Augustin
This is a step towards allowing applications without a models module.