| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Used abstract inheritance to cut down on code repetition.
|
|
When STATIC_ROOT wasn't set, collectstatic --clear would delete
every files within the current directory and its descendants.
This patch makes the following changes:
Prevent collectstatic from running if STATIC_ROOT isn't set.
Fixed an issue that prevented collectstatic from displaying the
destination directory.
Changed the warning header to notify when the command is run
in dry-run mode.
|
|
Thanks Marco Badan for the report.
|
|
|
|
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.
|
|
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.
|
|
|
|
This avoid leaking implementation details to tests that swap models.
|
|
Thanks Simon.
|
|
|
|
Thanks Simon for the suggestion.
Also removed inappropriate lowercasing of app labels in migrations.
Unlike model names, they are case sensitive.
|
|
Thanks Florian for isolating the shortest way to reproduce this issue:
./runtests.py \
django.contrib.auth.tests.test_context_processors.AuthContextProcessorTests.test_perms_attrs \
django.contrib.auth.tests.test_auth_backends.ChangedBackendSettingsTest.test_changed_backend_settings \
django.contrib.auth.tests.test_auth_backends.CustomUserModelBackendAuthenticateTest.test_authenticate \
django.contrib.auth.tests.test_basic.BasicTestCase.test_createsuperuser_management_command
|
|
De-aliased pre/post_syncdb to pre/post_migrate to increase
backwards-compatibility.
|
|
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.
get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.
Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
|
|
ContentTypes are only created for installed applications, and I could
make a case for not returning a model that isn't installed any more.
The check for stale ContentTypes in update_contenttypes doesn't use
model_class.
ModelSignal actually needs get_registered_model since the lookup happens
at import time. I took this opportunity to perform a small refactoring.
|
|
An admin view performed the capitalization in the template, unlike all others.
Refs #10436.
|
|
Eliminated the app_ prefix that was more confusing than useful.
|
|
|
|
|
|
Fixed a crash when executing changepassword command when the user object
representation contained non-ASCII characters.
|
|
|
|
GEOS 3.3 added crosses, disjoint, overlaps, touches and within
predicates on prepared geometries.
|
|
|
|
Thanks Robert Scott for the report.
|
|
Also renamed app_cache to apps and "app cache" to "app registry".
Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
|
|
|
|
It's now easier to achieve the same effect with modify_settings or
override_settings.
|
|
* Introduced [un]set_installed_apps to handle changes to the
INSTALLED_APPS setting.
* Refactored [un]set_available_apps to share its implementation
with [un]set_installed_apps.
* Implemented a receiver to clear some app-related caches.
* Removed test_missing_app as it is basically impossible to reproduce
this situation with public methods of the new app cache.
|
|
|
|
|
|
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
|
|
Except the app cache code and a few specific tests, of course.
|
|
Removed some exception masking in the comments app that was harmful and
couldn't be preserved easily.
|
|
Used the app cache's get_app_configs() method instead.
|
|
It was called _populate() before I renamed it to populate(). Since it
has been superseded by populate_models() there's no reason to keep it.
Removed the can_postpone argument of load_app() as it was only used by
populate(). It's a private API and there's no replacement. Simplified
load_app() accordingly. Then new version behaves exactly like the old
one even though it's much shorter.
|
|
Since applications that aren't installed no longer have an application
configuration, it is now always True in practice.
Provided an abstraction to temporarily add or remove applications as
several tests messed with app_config.installed to achieve this effect.
For now this API is _-prefixed because it looks dangerous.
|
|
This reverts commit a25fe3b65e39ff6f59ac545d7934461be6c13612.
It didn't do anything. It merely added to every PO file:
msgid "%(name)s"
msgstr "%(name)s"
Thanks Ramiro Morales for the report at:
https://groups.google.com/d/msg/Django-I18N/vc2vQzv80UQ/EuaW38V7X7sJ
Conflicts:
django/contrib/admin/templates/admin/index.html
|
|
* Removed ADMIN_FOR setting and warn warning
* Group view functions by namespace instead of site
* Added a test verifying namespaces are listed
Thanks to Claude Paroz for reviewing and ideas for improvement.
|
|
Used the information from the app cache instead of creating a duplicate
based on INSTALLED_APPS.
Model._meta.installed is no longer writable. It was a rather sketchy way
to alter private internals anyway.
|
|
Added comments in the three empty models.py files that are still needed.
Adjusted the test runner to add applications corresponding to test
labels to INSTALLED_APPS even when they don't have a models module.
|
|
|
|
This commit reverts f44c4a5d0f and 39bbd165.
django.test.simple will be updated in a separate commit as it requires
invasive changes.
|
|
|
|
|
|
Several parts of Django call get_apps() with a comment along this lines
of "this has the side effect of calling _populate()". I fail to see how
this is better than just calling populate()!
|
|
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.
They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.
This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
|
|
This commit doesn't contain any code changes; it's purely a refactoring.
|