| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2026-02-21 | Fixed #36935 -- Added fallback in ContentType.app_labeled_name when ↵ | Marco Aurélio da Rosa Haubrich | |
| model_class() is None. Updated ContentType.app_labeled_name to include the app_label in its string representation. This removed ambiguity for content types whose models were not present in the current codebase (for example, when multiple applications share the same database). Adjusted related tests to reflect the new representation. | |||
| 2024-06-24 | Fixed #35545, Refs #32833 -- Fixed ContentTypeManager.get_for_models() crash ↵ | Sarah Boyce | |
| in CreateModel migrations. Thank you to Csirmaz Bendegúz for the report and Simon Charettes for the review. | |||
| 2024-02-05 | Fixed #16281 -- Fixed ContentType.get_object_for_this_type() in a multiple ↵ | Ben Cail | |
| database setup. | |||
| 2023-03-09 | Fixed #33985 -- Used app_config.verbose_name in ContentType.__str__(). | Hrushikesh Vaidya | |
| 2022-10-10 | Fixed #32833 -- Fixed ContentTypeManager.get_for_models() crash when using ↵ | Sarah Boyce | |
| in migrations. Co-authored-by: Heraldo Lucena <23155511+HMaker@users.noreply.github.com> | |||
| 2022-03-15 | Removed unnecessary _connector from Q construction in get_for_models(). | Mariusz Felisiak | |
| Q._connector defaults to Q.AND. Follow up to 859a87d873ce7152af73ab851653b4e1c3ffea4c. | |||
| 2022-03-14 | Fixed #31357 -- Fixed get_for_models() crash for stale content types when ↵ | Biel Frontera | |
| model with the same name exists in another app. | |||
| 2022-02-07 | Refs #33476 -- Refactored code to strictly match 88 characters line length. | Mariusz Felisiak | |
| 2022-02-07 | Refs #33476 -- Reformatted code with Black. | django-bot | |
| 2020-05-04 | Refs #30573 -- Rephrased "Of Course" and "Obvious(ly)" in documentation and ↵ | Adam Johnson | |
| comments. | |||
| 2019-11-05 | Fixed #30947 -- Changed tuples to lists in model Meta options in ↵ | Jon Dufresne | |
| django.contrib modules. The Django "Model Meta options" docs provide examples and generally point the reader to use lists for the unique_together and ordering options. Follow our own advice for contrib models. More generally, lists should be used for homogeneous sequences of arbitrary lengths of which both unique_together and ordering are. | |||
| 2019-02-07 | Fixed #16027 -- Added app_label to ContentType.__str__(). | Gregory N. Schmit | |
| 2018-11-09 | Removed unused variables. | Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి) | |
| 2017-09-07 | Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()." | Tim Graham | |
| This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better. | |||
| 2017-06-28 | Fixed #27818 -- Replaced try/except/pass with contextlib.suppress(). | Mads Jensen | |
| 2017-04-27 | Refs #27795 -- Replaced many force_text() with str() | Claude Paroz | |
| Thanks Tim Graham for the review. | |||
| 2017-02-07 | Converted usage of ugettext* functions to their gettext* aliases | Claude Paroz | |
| Thanks Tim Graham for the review. | |||
| 2017-02-04 | Refs #27656 -- Updated django.contrib docstring verb style according to PEP 257. | Anton Samarchyan | |
| 2017-02-01 | Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. | Vytis Banaitis | |
| 2017-01-25 | Refs #23919 -- Replaced super(ClassName, self) with super(). | chillaranand | |
| 2017-01-18 | Refs #23919 -- Removed python_2_unicode_compatible decorator usage | Claude Paroz | |
| 2017-01-18 | Refs #23919 -- Removed encoding preambles and future imports | Claude Paroz | |
| 2017-01-13 | Fixed #27709 -- Fixed get_for_models() for proxies with an empty cache. | Simon Charette | |
| Thanks Peter Inglesby for the report and tests. | |||
| 2016-09-06 | Fixed #24865 -- Added remove_stale_contenttypes management command. | Tim Graham | |
| Thanks Simon Charette for the review. | |||
| 2016-05-15 | Fixed #24075 -- Used post-migration models in contrib apps receivers. | Simon Charette | |
| Thanks Markus and Tim for the review. | |||
| 2016-04-29 | Fixed #26207 -- Replaced dynamic classes with non-data descriptors for ↵ | Anssi Kääriäinen | |
| deferred instance loading. | |||
| 2016-02-26 | Fixed #26286 -- Prevented content type managers from sharing their cache. | Simon Charette | |
| This should prevent managers methods from returning content type instances registered to foreign apps now that these managers are also attached to models created during migration phases. Thanks Tim for the review. Refs #23822. | |||
| 2015-09-23 | Refs #24099 -- Removed compatibility shim for ContentType.name field. | Tim Graham | |
| 2015-06-24 | Renamed RemovedInDjangoXYWarnings for new roadmap. | Tim Graham | |
| Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more. | |||
| 2015-02-16 | Refs #24299 -- Made contenttypes migrations signal handler more robust. | Sergey Fedoseev | |
| 2015-02-06 | Sorted imports with isort; refs #23860. | Tim Graham | |
| 2015-01-16 | Fixed #24099 -- Removed contenttype.name deprecated field | Claude Paroz | |
| This finsishes the work started on #16803. Thanks Simon Charette, Tim Graham and Collin Anderson for the reviews. | |||
| 2015-01-08 | Removed unneeded smart_text calls | Claude Paroz | |
| `verbose_name_raw` return value comes from `force_text()` anyway. | |||
| 2014-12-15 | Fixed #23822 -- Added support for serializing model managers in migration | Markus Holtermann | |
| Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin, Tim Graham, Carl Meyer, and others for their review and input. | |||
| 2014-10-29 | Limited lines to 119 characters in django/{contrib,db}. | Berker Peksag | |
| Refs #23395. | |||
| 2014-09-05 | Fixed #22411: Throw a more helpful error if contenttypes doesn't exist. | Andrew Godwin | |
| 2014-06-16 | Added database migration for contrib.contenttypes. | Tim Graham | |
| Moved contenttypes tests to allow them to run correctly in the presence of migrations. refs #22170. | |||
| 2014-05-29 | Fixed #20401 -- ContentTypeManager.get_for_model reads from db_for_read. | Antonis Christofides | |
| Thanks Simon Charette and Tim Graham for the reviews. | |||
| 2013-12-28 | Changed get_model to raise an exception on errors. | Aymeric Augustin | |
| 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. | |||
| 2013-12-28 | Stopped calling apps.get_model with only_installed=False. | Aymeric Augustin | |
| 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. | |||
| 2013-12-24 | Renamed 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-22 | Moved apps back in the toplevel django namespace. | Aymeric Augustin | |
| Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2. | |||
| 2013-12-17 | Moved the new app cache inside core. | Aymeric Augustin | |
| 2013-12-17 | Removed module-level functions for the app cache. | Aymeric Augustin | |
| 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. | |||
| 2013-11-03 | Fixed flake8 E251 violations | Milton Mazzarri | |
| 2013-10-31 | Started attackign the next flake8 violation | Alex Gaynor | |
| 2013-05-21 | (Re-)moved some imports | Claude Paroz | |
| 2013-05-18 | Fix NoneType error when fetching a stale ContentType with get_for_id | Diederik van der Boor | |
| When a stale ContentType is fetched, the _add_to_cache() function didn't detect that `model_class()` returns `None` (which it does by design). However, the `app_label` + `model` fields can be used instead to as local cache key. Third party apps can detect stale models by checking whether `model_class()` returns `None`. Ticket: https://code.djangoproject.com/ticket/20442 | |||
| 2013-02-05 | Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`. | Simon Charette | |
| 2012-08-12 | [py3] Refactored __unicode__ to __str__. | Aymeric Augustin | |
| * Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2 | |||
