summaryrefslogtreecommitdiff
path: root/django/db/models/options.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed #22172 -- Allowed index_together to be a single list (rather than list ↵Anubhav Joshi2014-03-011-9/+14
| | | | | | of lists).. Thanks EmilStenstrom for the suggestion.
* Fixed #16905 -- Added extensible checks (nee validation) frameworkRussell Keith-Magee2014-01-201-7/+12
| | | | | | | | | This is the result of Christopher Medrela's 2013 Summer of Code project. Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian Apolloner, and Alex Gaynor for review notes along the way. Also: Fixes #8579, fixes #3055, fixes #19844.
* Small style cleanup.Aymeric Augustin2013-12-311-4/+8
|
* Removed the only_installed argument of Apps.get_models.Aymeric Augustin2013-12-281-2/+2
| | | | Refs #15903, #15866, #15850.
* Turned apps.ready into a property. Added tests.Aymeric Augustin2013-12-261-2/+2
|
* Removed a few gratuitous lambdas.Aymeric Augustin2013-12-261-5/+3
|
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-9/+9
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Terminated AppCache._populate() with extreme prejudice.Aymeric Augustin2013-12-221-1/+1
| | | | | | | | | | 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.
* Removed the app_config.installed flag.Aymeric Augustin2013-12-221-2/+2
| | | | | | | | | 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.
* Normalized Model._meta.installed.Aymeric Augustin2013-12-171-1/+9
| | | | | | | | 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.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-171-4/+4
| | | | | | | | | | | | | | | 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.
* Moved django.db.models.loading to django.apps.cache.Aymeric Augustin2013-12-171-1/+1
| | | | This commit doesn't contain any code changes; it's purely a refactoring.
* Fixed ModelState breaking when unique_together has unhashable elements.Baptiste Mispelon2013-12-061-3/+6
|
* Fixed #21469 -- Allow set objects in Meta.unique_together.Baptiste Mispelon2013-11-201-0/+1
| | | | Thanks to Tim for the review.
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+2
|
* Fixed #21236 -- Allowed migrations to work with unique_together tuples.Javed Khan2013-10-071-6/+11
| | | | Thanks hjwp for the report.
* Fixed #17627 -- Renamed util.py files to utils.pyTim Graham2013-09-161-1/+1
| | | | | Thanks PaulM for the suggestion and Luke Granger-Brown and Wiktor Kołodziej for the initial patch.
* Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette2013-08-301-1/+1
|
* Fixed #20988 -- Added model meta option select_on_saveAnssi Kääriäinen2013-08-301-1/+3
| | | | | | | | | | | The option can be used to force pre 1.6 style SELECT on save behaviour. This is needed in case the database returns zero updated rows even if there is a matching row in the DB. One such case is PostgreSQL update trigger that returns NULL. Reviewed by Tim Graham. Refs #16649
* Add more stringent M2M tests and fix the bug they exposedAndrew Godwin2013-08-191-3/+3
|
* Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-08-091-2/+3
|\ | | | | | | | | Conflicts: django/db/models/options.py
| * Fixed #9057 -- Added default_permissions model meta option.Tim Graham2013-08-091-1/+2
| | | | | | | | Thanks hvendelbo for the suggestion and koenb for the draft patch.
* | Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-08-091-11/+12
|\ \ | |/ | | | | | | | | | | | | | | | | Conflicts: django/core/management/commands/flush.py django/core/management/commands/syncdb.py django/db/models/loading.py docs/internals/deprecation.txt docs/ref/django-admin.txt docs/releases/1.7.txt
| * Deprecated SortedDict (replaced with collections.OrderedDict)Curtis Maloney2013-08-041-5/+5
| | | | | | | | Thanks Loic Bistuer for the review.
| * Removed unused model option "admin"Tim Graham2013-08-011-1/+0
| |
| * Added field.attname to Options.name_mapAnssi Kääriäinen2013-07-311-3/+4
| | | | | | | | The change also removed allow_explicit_fk from sql/query.py.
| * Fixed ._meta.pk_index() virtual field failureAnssi Kääriäinen2013-07-251-2/+3
| |
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-07-021-4/+4
|\ \ | |/
| * Advanced deprecation warnings for Django 1.7.Aymeric Augustin2013-06-291-4/+4
| |
* | Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2013-06-281-0/+24
|\ \ | |/ | | | | | | | | | | Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py tests/field_deconstruction/tests.py
| * Fixed #20642 -- Deprecated `Option.get_(add|change|delete)_permission`.Simon Charette2013-06-251-0/+24
| | | | | | | | | | | | | | | | | | Those methods were only used by `contrib.admin` internally and exclusively related to `contrib.auth`. Since they were undocumented but used in the wild the raised deprecation warning point to an also undocumented alternative that lives in `contrib.auth`. Also did some PEP8 and other cleanups in the affected modules.
* | ModelState now freezes options and basesAndrew Godwin2013-05-191-0/+6
| |
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-05-181-1/+1
|\ \ | |/
| * Replaced an antiquated pattern.Aymeric Augustin2013-05-171-1/+1
| | | | | | | | Thanks Lennart Regebro for pointing it out.
* | Split out a BaseAppCache, make AppCache borg again, add _meta.app_cacheAndrew Godwin2013-05-091-4/+4
| |
* | Merge branch 'master' into schema-alterationAndrew Godwin2013-04-181-19/+74
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: django/db/backends/__init__.py django/db/backends/mysql/base.py django/db/backends/oracle/base.py django/db/backends/oracle/creation.py django/db/backends/postgresql_psycopg2/base.py django/db/backends/sqlite3/base.py django/db/models/fields/related.py
| * Fixed #19385 again, now with real code changesAnssi Kääriäinen2013-03-241-3/+35
| | | | | | | | | | The commit of 266de5f9ae9e9f2fbfaec3b7e4b5fb9941967801 included only tests, this time also code changes included...
| * Fixed #19689 -- Renamed `Model._meta.module_name` to `model_name`.Simon Charette2013-02-051-9/+20
| |
| * Avoided unnecessary recreation of RelatedObjectsAnssi Kääriäinen2013-01-181-5/+4
| | | | | | | | Refs #19399. Thanks to Track alias KJ for the patch.
| * Fixed #19401 -- Ensure that swappable model references are case insensitive.Russell Keith-Magee2012-12-201-3/+16
| | | | | | | | | | | | | | This is necessary because get_model() checks are case insensitive, and if the swapable check isn't, the swappable logic gets tied up in knots with models that are partially swapped out. Thanks to chris@cogdon.org for the report and extensive analysis, and Preston for his work on the draft patch.
* | Merge remote-tracking branch 'core/master' into schema-alterationAndrew Godwin2012-12-181-46/+14
|\ \ | |/ | | | | | | | | Conflicts: django/db/models/loading.py django/db/models/options.py
| * Fixed #19469 -- Removed opts.get_ordered_objects() and related codeAnssi Kääriäinen2012-12-161-13/+0
| | | | | | | | The code was dead-code since 2006.
| * Removed duplicate opts.pk_index() methodAnssi Kääriäinen2012-11-271-8/+4
| |
| * Fixed #13781 -- Improved select_related in inheritance situationsAnssi Kääriäinen2012-11-151-3/+3
| | | | | | | | | | | | | | | | | | The select_related code got confused when it needed to travel a reverse relation to a model which had different parent than the originally travelled relation. Thanks to Trac aliases shauncutts for report and ungenio for original patch (committed patch is somewhat modified version of that).
| * Fixed select_related performance regressionsAnssi Kääriäinen2012-11-131-4/+7
| | | | | | | | | | The regression was caused by select_related fix for Oracle, commit c159d9cec0baab7bbd04d5d51a92a51e354a722a.
| * Fixed #5805 -- it is now possible to specify multi-column indexes. Thanks to ↵Alex Gaynor2012-11-041-1/+3
| | | | | | | | jgelens for the original patch.
| * Removed dupe_avoidance from sql/query and sql/compiler.pyAnssi Kääriäinen2012-10-311-19/+0
| | | | | | | | | | | | | | | | | | | | The dupe avoidance logic was removed as it doesn't seem to do anything, it is complicated, and it has nearly zero documentation. The removal of dupe_avoidance allowed for refactoring of both the implementation and signature of Query.join(). This refactoring cascades again to some other parts. The most significant of them is the changes in qs.combine(), and compiler.select_related_descent().
* | Merge branch 'master' into schema-alterationAndrew Godwin2012-10-261-13/+32
|\ \ | |/ | | | | | | | | | | Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py django/db/models/options.py