- 17 Ara, 2013 23 kayıt (commit)
-
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Thanks Marc Tamlyn for the suggestion.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Thanks Florian for catching this mistake.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
This commit reverts f44c4a5d and 39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
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()!
-
Aymeric Augustin yazdı
Since it's never called with more than one model at a time the current signature is needlessly complicated.
-
Aymeric Augustin yazdı
It feels more natural for self.available_apps to contain app names (like INSTALLED_APPS) than app labels, and this is easy to implement now.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
Refactored get_apps() to rely on that method. This commit is fully backwards-compatible.
-
Aymeric Augustin yazdı
Refactored get_app() to rely on that method. get_app() starts by calling _populate(), which goes through INSTALLED_APPS and, for each app, imports the app module and attempts to import the models module. At this point, no further imports are necessary to return the models module for a given app. Therefore, the implementation of get_app() can be simplified and the safeguards for race conditions can be removed. Besides, the emptyOK parameter isn't used anywhere in Django. It was introduced in d6c95e93 but not actually used nor documented, and it has just been carried around since then. Since it's an obscure private API, it's acceptable to stop supporting it without a deprecation path. This branch aims at providing first-class support for applications without a models module eventually. For backwards-compatibility, get_app() still raises ImproperlyConfigured when an app isn't found, even though LookupError is technically more correct. I haven't gone as far as to preserve the exact error messages. I've adjusted a few tests instead.
-
Aymeric Augustin yazdı
Marginally improved creation of AppConfig stubs for non-installed apps.
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
get_app_errors() always returned an empty dictionary; this behavior is preserved in django.db.models.loading until that module is deprecated.
-
Aymeric Augustin yazdı
This is a step towards allowing applications without a models module.
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
Its only difference with OrderedDict is that it didn't deepcopy its keys. However it wasn't used anywhere with models modules as keys, only as values. So this commit doesn't result in any change in functionality.
-
Aymeric Augustin yazdı
It was only storing redundant information. This is part of the effort to allow applications without a models module.
-
Aymeric Augustin yazdı
This commit doesn't contain any code changes; it's purely a refactoring.
-
- 16 Ara, 2013 5 kayıt (commit)
-
-
Artur Barseghyan yazdı
-
Loic Bistuer yazdı
-
Baptiste Mispelon yazdı
Thanks to trac user adepue for the report and original patch.
-
Baptiste Mispelon yazdı
-
Vajrasky Kok yazdı
Refs #21574
-
- 15 Ara, 2013 7 kayıt (commit)
-
-
Baptiste Mispelon yazdı
-
Peter Harley yazdı
Thanks to Keryn Knight for the report.
-
Alex Gaynor yazdı
Typo in 1.7 release notes
-
Aymeric Augustin yazdı
-
Andrew Godwin yazdı
-
Bruno Renié yazdı
-
Baptiste Mispelon yazdı
-
- 14 Ara, 2013 5 kayıt (commit)
-
-
Alasdair Nicol yazdı
-
Claude Paroz yazdı
This reverts commit 07fe0bf3. This was not working properly on system without geos library installed.
-
Bartolomé Sánchez yazdı
Currently, if the authentication mechanism uses a custom HTTP header and not REMOTE_USER, it is not easy to test. This commit modifies remote user tests in order to make them more generic.
-
Marti Raudsepp yazdı
Small nitpicks. All column-related ALTER TABLE commands take an exclusive table lock in PostgreSQL. The difference is that adding a column without default doesn't cause a table rewrite, so the lock is held only for a short time. The time taken is more accurately proportional to table size, not row count.
-
Loic Bistuer yazdı
-