- 28 Ara, 2013 14 kayıt (commit)
-
-
Aymeric Augustin yazdı
Documented them as public APIs.
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
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.
-
Tim Graham yazdı
-
ijl yazdı
Previously, only the URL path was included in the cache key. Thanks jamey for the suggestion.
-
Florian Apolloner yazdı
-
Ramiro Morales yazdı
Made it use 'AUTOINCREMENT' suffix for PK creation. This way it doeesn't regress when compared with the 'traditional' DB backend creation infrastructure. Refs #10164.
-
Florian Apolloner yazdı
Thanks to Arfrever for the report and Aymeric for the review.
-
Claude Paroz yazdı
Thanks kz26 for the report and Tim Graham for the excellent review.
-
Aymeric Augustin yazdı
The last component of the dotted path to the application module is consistently referenced as the application "label". For instance it's AppConfig.label. appname could be confused with AppConfig.name, which is the full dotted path.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
register_model is called exactly once in the entire Django code base, at the bottom of ModelBase.__new__: new_class._meta.apps.register_model(new_class._meta.app_label, new_class) ModelBase.__new__ exits prematurely 120 lines earlier (sigh) if a model with the same name is already registered: if new_class._meta.apps.get_registered_model(new_class._meta.app_label, name): return (This isn't the exact code, but it's equivalent.) apps.register_model and apps.get_registered_model are essentially a setter and a getter for apps.all_models, and apps.register_model is the only setter. As a consequence, new_class._meta.apps.all_models cannot change in-between. Considering that name == new_class.__name__, we can conclude that register_model(app_label, model) is always called with such arguments that get_registered_model(app_label, model.__name__) returns None. Considering that model._meta.model_name == model.__name__.lower(), and looking at the implementation of register_model and get_registered_model, this proves that self.all_models[app_label] doesn't contain model._meta.model_name in register_model, allowing us to simplify the implementation.
-
Ramiro Morales yazdı
Refs #21692 and 3efd1b8b.
-
- 27 Ara, 2013 10 kayıt (commit)
-
-
Ramiro Morales yazdı
Fixed #21692 -- Quote table name when creating it.
-
Aymeric Augustin yazdı
The u prefix looks bad on Python 2.
-
Ramiro Morales yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Tim Graham yazdı
Thanks nedbatchelder and claudep.
-
Aymeric Augustin yazdı
Mostly for consistency with MODELS_MODULE_NAME; it's unlikely to change.
-
Florian Apolloner yazdı
-
Florian Apolloner yazdı
-
Tim Graham yazdı
Thanks oubiga for the report.
-
- 26 Ara, 2013 16 kayıt (commit)
-
-
Aymeric Augustin yazdı
An admin view performed the capitalization in the template, unlike all others. Refs #10436.
-
Tim Graham yazdı
Thanks Aymeric for the suggestion.
-
Aymeric Augustin yazdı
-
Tim Graham yazdı
Thanks cjerdonek for the suggestion.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
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.
-
Aymeric Augustin yazdı
Eliminated the app_ prefix that was more confusing than useful.
-
Aymeric Augustin yazdı
Previously the _apps/models_loaded flags could remain set to False if set_installed_apps exited with an exception, which is going to happen as soon as we add tests for invalid values of INSTALLED_APPS.
-
Aymeric Augustin yazdı
-
Preston Timmons yazdı
Thanks thepapermen for the report and Carl Meyer for the review.
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Aymeric Augustin yazdı
-
Tim Graham yazdı
-
Jon Lønne yazdı
Fixed a crash when executing changepassword command when the user object representation contained non-ASCII characters.
-