| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
unhandled lazy ops error.
|
|
|
|
| |
AppConfig.
|
|
|
|
|
|
|
|
|
|
| |
Moved the lookup in Field.swappable_setting to Apps, and added
an lru_cache to cache the results.
Refs #24743
Thanks Marten Kenbeek for the initial work on the patch. Thanks Aymeric
Augustin and Tim Graham for the review.
|
| |
|
| |
|
| |
|
|
|
|
| |
message on fully-qualified package names.
|
|
|
|
|
|
|
| |
This adds a new method, Apps.lazy_model_operation(), and a helper function,
lazy_related_operation(), which together supersede add_lazy_relation() and
make lazy model operations the responsibility of the App registry. This
system no longer uses the class_prepared signal.
|
|
|
|
|
|
|
|
| |
Set apps.ready to False when rendering multiple models. This prevents
that the cache on Model._meta is expired on all models after each time a
single model is rendered. Prevented that Apps.clear_cache() refills the
cache on Apps.get_models(), so that the wrong value cannot be cached
when cloning a StateApps.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of
Code 2014 project and everyone else who helped with the patch!
|
|
|
|
| |
Thanks dfunckt and Tim Graham.
|
|
|
|
|
|
|
|
|
|
|
| |
is reloaded.
Previously a RuntimeError was raised every time two models clashed
in the app registry. This prevented reloading a module in a REPL;
while it's not recommended to do so, we decided not to forbid this
use-case by turning the error into a warning.
Thanks @dfunckt and Sergey Pashinin for the initial patches.
|
|
|
|
|
|
|
| |
This reverts commit 6fa9fa91a5fcb228b3c385b35a2018b3821a447a.
Aymeric: "I chose not to talk about django.setup() here on purpose.
This will hardly always be the correct solution."
|
| |
|
|
|
|
|
| |
If loading an application trigger an ImportError, the details of that
error were lost in some cases. Thanks Ben Davis for the report.
|
|
|
|
|
| |
Accounted for the three stages of population: app configs, models,
ready() methods of app configs.
|
|
|
|
|
|
| |
translation setup
Thanks Tim Graham and Aymeric Augustin for the review.
|
|
|
|
|
|
|
| |
to-be-removed-in-django-XX warnings
Thanks Anssi Kääriäinen for the idea and Simon Charette for the
review.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
filesystem path.
Wherever possible this filesystem path is derived automatically from the app
module's ``__path__`` and ``__file__`` attributes (this avoids any
backwards-compatibility problems).
AppConfig allows specifying an app's filesystem location explicitly, which
overrides all autodetection based on ``__path__`` and ``__file__``. This
permits Django to support any type of module as an app (namespace packages,
fake modules, modules loaded by other hypothetical non-filesystem module
loaders), as long as the app is configured with an explicit filesystem path.
Thanks Aymeric for review and discussion.
|
| |
|
| |
|
|
|
|
| |
Also added tests for get_model.
|
|
|
|
|
|
|
|
|
|
| |
namespace packages as 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.
|
|
|
|
|
| |
Thanks Russell for the report, Marc for the initial patch, Carl for the
final review, and everyone who contributed to the design discussion.
|
|
|
|
|
|
| |
custom label.
Thanks Aymeric for design discussion.
|
| |
|
|
|
|
|
|
|
|
| |
Since the app registry is always populated before the first request is
processed, the situation described in #18251 for the old app cache
cannot happen any more.
Refs #18251, #21628.
|
| |
|
| |
|
|
|
|
|
|
| |
Thanks Jannis and Marc for the feedback.
Fixed #21717.
|
|
|
|
| |
Fixed #21679.
|
|
|
|
|
|
| |
configuration.
Fixed #21683.
|
|
|
|
|
|
|
|
|
| |
app registry.
This check will miss duplicates until the check for duplicate labels is
added.
Refs #21679.
|
|
|
|
| |
Fixed #21715.
|
|
|
|
|
|
|
|
|
| |
get_model[s].
Now that the refactorings are complete, it isn't particularly useful any
more, nor very well named. Let's keep the API as simple as possible.
Fixed #21689.
|
|
|
|
|
|
|
| |
After the recent series of refactorings, there's no reason to keep
two distinct methods.
Refs #21681.
|
|
|
|
|
|
|
|
|
|
| |
To the best of my understanding, since populate_models() is now called
as soon as Django starts, it cannot be called while a models module is
being imported, and that removes the need for postponing.
(If hell breaks loose we'll revert this commit.)
Refs #21681.
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
Use app_config.get_models() instead.
|
| |
|
| |
|
|
|
|
| |
This avoid leaking implementation details to tests that swap models.
|