summaryrefslogtreecommitdiff
path: root/django/contrib/contenttypes/management.py
AgeCommit message (Collapse)Author
2016-09-06Fixed #24865 -- Added remove_stale_contenttypes management command.Tim Graham
Thanks Simon Charette for the review.
2016-08-10Refs #18682 -- Edited explanation in stale content type deletion.Tim Graham
Follow up to 8db889eaf7dce0cb715b075be32047c1b1b316da.
2016-07-03Fixed #18682 -- Expanded explanation in stale content type deletion. (#6869)Erik Romijn
2016-05-17Fixed #24067 -- Renamed content types upon model renaming.Simon Charette
Thanks to Tim for the extensive review.
2016-05-15Fixed #24075 -- Used post-migration models in contrib apps receivers.Simon Charette
Thanks Markus and Tim for the review.
2015-02-20Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583.
2015-02-07Revert "Fixed #24075 -- Prevented running post_migrate signals when ↵Markus Holtermann
unapplying initial migrations of contenttypes and auth" This reverts commit 737d24923ac69bb8b89af1bb2f3f4c4c744349e8.
2015-01-16Fixed #24099 -- Removed contenttype.name deprecated fieldClaude Paroz
This finsishes the work started on #16803. Thanks Simon Charette, Tim Graham and Collin Anderson for the reviews.
2015-01-14Fixed #24075 -- Prevented running post_migrate signals when unapplying ↵Markus Holtermann
initial migrations of contenttypes and auth Thanks Florian Apolloner for the report and Claude Paroz and Tim Graham for the review and help on the patch.
2015-01-09Removed an undocumented contenttypes synchronization method.Simon Charette
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-11-27Fixed #23641 -- Moved post_migrate signals for contrib apps to ↵wrwrwr
AppConfig.ready().
2014-07-23Fixed #23078 -- Regression in update_contenttypes() interactivity.Nick Sandford
Thanks raymond at adaptiv.nl for the report.
2014-01-12Fixed #21477 -- Renamed db to using in pre/post_migrate signals.Aymeric Augustin
2013-12-30Removed the only_with_models_module argument of get_model[s].Aymeric Augustin
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.
2013-12-29Added AppConfig.get_models().Aymeric Augustin
2013-12-29Refactored the migration signals to use app configs.Aymeric Augustin
De-aliased pre/post_syncdb to pre/post_migrate to increase backwards-compatibility.
2013-12-28Changed 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-24Renamed 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-23Refactored INSTALLED_APPS overrides.Aymeric Augustin
* 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.
2013-12-22Moved apps back in the toplevel django namespace.Aymeric Augustin
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
2013-12-17Moved the new app cache inside core.Aymeric Augustin
2013-12-17Made it possible to create apps without a models module.Aymeric Augustin
This commit reverts f44c4a5d0f and 39bbd165. django.test.simple will be updated in a separate commit as it requires invasive changes.
2013-12-17Deprecated get_apps().Aymeric Augustin
2013-12-17Removed 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-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-07-30Rename allow_syncdb to allow_migrateAndrew Godwin
2013-07-30Rename pre_ and post_syncdb to *_migrate, with aliases from old namesAndrew Godwin
2013-06-10Added TransactionTestCase.available_apps.Aymeric Augustin
This can be used to make Django's test suite significantly faster by reducing the number of models for which content types and permissions must be created and tables must be flushed in each non-transactional test. It's documented for Django contributors and committers but it's branded as a private API to preserve our freedom to change it in the future. Most of the credit goes to Anssi. He got the idea and did the research. Fixed #20483.
2013-02-05Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette
2012-11-24Fixed #19806 -- Ensure that content types and permissions aren't created for ↵Russell Keith-Magee
swapped models. Thanks to rizumu for the report.
2012-11-22Fixed #16039 -- Made post_syncdb handlers multi-db aware.Aymeric Augustin
Also reverted 8fb7a9002669fb7ba7bec7df90b465b92e1ed3c2. Refs #17055.
2012-08-08[py3] Replaced raw_input by inputClaude Paroz
The six addition has been borrowed from: https://bitbucket.org/gutworth/six/changeset/733ef740
2012-08-07[py3] Ported django.utils.encoding.Aymeric Augustin
* Renamed smart_unicode to smart_text (but kept the old name under Python 2 for backwards compatibility). * Renamed smart_str to smart_bytes. * Re-introduced smart_str as an alias for smart_text under Python 3 and smart_bytes under Python 2 (which is backwards compatible). Thus smart_str always returns a str objects. * Used the new smart_str in a few places where both Python 2 and 3 want a str.
2012-08-07[py3] Fixed access to dict keys/values/items.Aymeric Augustin
2012-04-30Replaced print statement by print function (forward compatibility syntax).Claude Paroz
2011-09-15Fixed #16854 -- corrected an AttributeError coming from the contenttypes ↵Alex Gaynor
post-syncdb hook. Thanks to desh for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16832 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-09Fixed #7596. Added Model.objects.bulk_create, and make use of it in several ↵Alex Gaynor
places. This provides a performance benefit when inserting multiple objects. THanks to Russ for the review, and Simon Meers for the MySQl implementation. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-15Fixed #12339 -- Made content type deletion an interactive process to prevent ↵Russell Keith-Magee
accidentally cascade deleting content from a production database. Thanks to kcarnold for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-10Fixed #12999 -- Modified the contenttypes syncdb handler to use db router ↵Russell Keith-Magee
logic. Thanks to lsbardel for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-06Major refactoring of django.dispatch with an eye towards speed. The net ↵Jacob Kaplan-Moss
result is that signals are up to 90% faster. Though some attempts and backwards-compatibility were made, speed trumped compatibility. Thus, as usual, check BackwardsIncompatibleChanges for the complete list of backwards-incompatible changes. Thanks to Jeremy Dunck and Keith Busell for the bulk of the work; some ideas from Brian Herring's previous work (refs #4561) were incorporated. Documentation is, sigh, still forthcoming. Fixes #6814 and #3951 (with the new dispatch_uid argument to connect). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Fixed #5177 -- Changed content type creation to also remove the types for ↵Malcolm Tredinnick
any orphaned entries (so it's now an "update" feature). Thanks, Rob Hudson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6287 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
backwards compatible for all practical purposes. Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702 git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-11Added {{{ContentType.objects.clear_cache()}}} which clears the lookup cache. ↵Jacob Kaplan-Moss
This needs to be called at syncdb time to avoid "stale" content-type IDs after the database gets flushed during unit tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-12-07Added django.contrib.contenttypes.management.create_all_contenttypes() ↵Adrian Holovaty
function for convenience git-svn-id: http://code.djangoproject.com/svn/django/trunk@4183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-27Refs #2333 - Added 'test' target to django-admin script. Includes addition ↵Russell Keith-Magee
of --verbosity and --noinput options to django-admin, and a new TEST_RUNNER setting to control the tool used to execute tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-06-19Fixed #1856 -- install content-type entries and auth permissions forMalcolm Tredinnick
models regardless of the presence of an inner Admin class. Patch from Mathew Flanagan. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3148 bcc190cf-cafb-0310-a4f2-bffc1f526a37