summaryrefslogtreecommitdiff
path: root/django/db/models/options.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #27236 -- Made more cosmetic edits to Meta.index_together deprecation.Mariusz Felisiak2023-05-051-2/+1
|
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-011-0/+1
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #18468 -- Added support for comments on columns and tables.kimsoungryoul2022-12-281-0/+2
| | | | | | | | Thanks Jared Chung, Tom Carrick, David Smith, Nick Pope, and Mariusz Felisiak for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
* Refs #32095 -- Added model's Options._non_pk_concrete_field_names property.sarahboyce2022-09-291-0/+14
|
* Refs #27236 -- Made cosmetic edits to Meta.index_together deprecation.Mariusz Felisiak2022-07-211-1/+2
| | | | This should make it more straightforward to move forward when deprecation ends.
* Fixed #27236 -- Deprecated Meta.index_together in favor of Meta.indexes.David Wobrock2022-07-121-0/+8
| | | | This also deprecates AlterIndexTogether migration operation.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-2/+2
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-84/+177
|
* Fixed #33335 -- Made model validation ignore functional unique constraints.Hannes Ljungberg2021-12-061-1/+5
| | | | | | Regression in 3aa545281e0c0f9fac93753e3769df9e0334dbaa. Thanks Hervé Le Roy for the report.
* Fixed #32996 -- Cached PathInfos on relations.Keryn Knight2021-11-031-1/+1
| | | | | | PathInfo values are ostensibly static over the lifetime of the object for which they're requested, so the data can be memoized, quickly amortising the cost over the process' duration.
* Removed unused model's Options.installed.Mariusz Felisiak2021-10-281-4/+0
| | | Unused since f9698c43918c118a29516cbef4e23c197eb2dc25.
* Fixed #31007 -- Allowed specifying type of auto-created primary keys.Tom Forbes2020-12-151-2/+35
| | | | | This also changes the default type of auto-created primary keys for new apps and projects to BigAutoField.
* Refs #27666 -- Ensured relationship consistency on delayed reloads.Simon Charette2020-04-071-2/+3
| | | | | | | | | | | | Delayed reloads of state models broke identity based relationships between direct and non-direct ancestors. Basing models.Options related objects map of model labels instead of their identity ensured relationship consistency is maintained. Refs #30966. Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* Refs #31187 -- Added total_unique_constraints property to model's Options.Mariusz Felisiak2020-02-191-1/+13
|
* Simplified imports from django.db and django.contrib.gis.db.Nick Pope2020-02-041-3/+1
|
* Used model's Options.label/label_lower where applicable.Mariusz Felisiak2020-01-291-1/+1
|
* Fixed #29998 -- Allowed multiple OneToOneFields to the parent model.Mariusz Felisiak2020-01-161-5/+1
| | | | | | | | | | We assumed that any OneToOneField's in a child model must be the parent link and raised an error when parent_link=True was not specified. This patch allows to specify multiple OneToOneField's to the parent model. OneToOneField's without a custom related_name will raise fields.E304 and fields.E305 so this should warn users when they try to override the auto-created OneToOneField.
* Simplified model's Options.add_field() a bit.Taoup2020-01-071-3/+3
|
* Refs #29444 -- Allowed returning multiple fields from INSERT statements on ↵Johannes Hoppe2019-09-091-0/+11
| | | | | | | PostgreSQL. Thanks Florian Apolloner, Tim Graham, Simon Charette, Nick Pope, and Mariusz Felisiak for reviews.
* Fixed #30397 -- Added app_label/class interpolation for names of indexes and ↵can2019-07-081-0/+18
| | | | constraints.
* Fixed #30159 -- Removed unneeded use of OrderedDict.Nick Pope2019-02-061-2/+2
| | | | Dicts preserve order since Python 3.6.
* Refs #28750 -- Removed suppport for model Meta.manager_inheritance_from_future.Tim Graham2019-01-171-2/+0
|
* Fixed #11964 -- Added support for database check constraints.Ian Foote2018-07-101-1/+2
|
* Fixed #8936 -- Added a view permission and a read-only admin.olivierdalang2018-05-161-1/+1
| | | | | Co-authored-by: Petr Dlouhy <petr.dlouhy@email.cz> Co-authored-by: Olivier Dalang <olivier.dalang@gmail.com>
* Fixed #28996 -- Simplified some boolean constructs and removed trivial ↵Дилян Палаузов2018-01-121-6/+4
| | | | continue statements.
* Fixed #28750 -- Allowed models to define ↵Charlie Denton2017-10-311-0/+2
| | | | | Meta.manager_inheritance_from_future for backwards compatibility. Refs 631f4ab06112aca5bd6a57b81159048f936050bf.
* Refs #27532 -- Removed Model._meta.has_auto_field per deprecation timeline.Tim Graham2017-09-221-15/+0
|
* Fixed #27332 -- Added FilteredRelation API for conditional join (ON clause) ↵Nicolas Delaby2017-09-221-1/+9
| | | | | support. Thanks Anssi Kääriäinen for contributing to the patch.
* Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham2017-09-071-5/+12
| | | | This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
* Simplified model's Options._get_fields() a bit.Sergey Fedoseev2017-08-311-7/+3
|
* Removed unneeded iter() calls.Sergey Fedoseev2017-08-231-1/+1
| | | A few of these were unnecessarily added in 2b281cc35ed9d997614ca3c416928d7fabfef1ad.
* Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen2017-06-281-12/+5
|
* Fixed #28269 -- Fixed Model.__init__() crash on models with a field that has ↵Adam Johnson2017-06-051-4/+7
| | | | | | an instance only descriptor. Regression in d2a26c1a90e837777dabdf3d67ceec4d2a70fb86.
* Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne2017-06-011-1/+1
|
* Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne2017-05-271-1/+1
| | | iter(dict) is equivalent to iter(dict.keys()).
* Fixed #28222 -- Allowed settable properties in ↵Alex2017-05-271-4/+1
| | | | QuerySet.update_or_create()/get_or_create() defaults.
* Refs #27795 -- Replaced many force_text() with str()Claude Paroz2017-04-271-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan2017-02-281-15/+11
|
* Fixed #27742 -- Reverted "Fixed #24607 -- Serialized natural keys in ↵Tim Graham2017-02-111-6/+1
| | | | | | | multi-table inheritance models." This reverts commit 74a575eb7296fb04e1fc2bd4e3f68dee3c66ee0a as it causes unexpected migrations and doesn't seem to be the best solution.
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-2/+2
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-2/+1
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Removed Manager.use_for_related_fields and Meta.manager_inheritance_from_future.Tim Graham2017-01-171-28/+2
| | | | Per deprecation timeline. Refs ed0ff913c648b16c4471fc9a9441d1ee48cb5420.
* Refs #26320 -- Removed implicit OneToOnField parent_link per deprecation ↵Tim Graham2017-01-171-4/+3
| | | | timeline.
* Refs #16508 -- Removed virtual aliases of "private fields".Tim Graham2017-01-171-18/+1
| | | | Per deprecation timeline.
* Optimized Model instantiation a bit.Adam Chainz2016-12-151-0/+11
| | | | | | | * Avoid some unnecessary attribute lookups, e.g. access signals directly rather than from module * Alias some repeat accesses inside the method to use the slightly faster local lookups * Use tuple to iterate remaining kwargs as it's faster to construct * Cache Field.get_default() to avoid running through all the logic on every call * Use a cached list of the properties on the model class to avoid repeat isinstance() calls
* Fixed #17002 -- Allowed using a ManyToManyField through model that inherits ↵InvalidInterrupt2016-12-071-0/+45
| | | | another.
* Fixed #27532 -- Deprecated Model._meta.has_auto_fieldAdam Chainz2016-11-251-2/+15
|