summaryrefslogtreecommitdiff
path: root/docs/ref/models
AgeCommit message (Collapse)Author
2025-08-13Aligned format of constraint examples in docs/ref/models/constraints.txt.David Sanders
2025-08-04Fixed #35972 -- Fixed lookup crashes after subquery annotations.Jacob Walls
2025-07-23Removed double spaces after periods and within phrases.Sarah Boyce
2025-06-11Fixed #36425 -- Standardized integer fields descriptions.junghwan16
2025-05-20Fixed #34262 -- Added support for AnyValue for SQLite, MySQL, Oracle, and ↵ontowhee
Postgresql 16+. Thanks Simon Charette for the guidance and review. Thanks Tim Schilling for the documentation review. Thanks David Wobrock for investigation and solution proposals.
2025-05-02Fixed #17461 -- Doc'd the presumed order of foreign keys on the intermediary ↵Clifford Gama
model of a self-referential m2m. Thanks Giannis Terzopoulos and Sarah Boyce for the reviews.
2025-04-15Fixed #36311 -- Unified spelling of "hardcode" and its variants in docs.Ahmed Nassar
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2025-04-02Fixed #36213 -- Doc'd MySQL's handling of self-select updates in ↵Babak Mahmoudy
QuerySet.update(). Co-authored-by: Andro Ranogajec <ranogaet@gmail.com>
2025-03-26Fixed #36260 -- Made bulk_create() work with DB-generated primary keys.Dmitry Shachnev
Co-authored-by: Simon Charette <charette.s@gmail.com>
2025-03-25Fixed #36262 -- Made GeneratedField.db_persist a required key-word argument.Jason Cameron
2025-03-21Refs #36095 -- Doc'd that ManyToManyField.through supports lazy relationships.Clifford Gama
2025-03-14Fixed pronoun disagreement in docs/ref/models/querysets.txt.Clifford Gama
2025-03-14Corrected aggregation example in docs/ref/models/querysets.txt.Clifford Gama
2025-03-13Fixed incorrect formatting for inline pluralized code references in docs.Clifford Gama
2025-03-10Fixed #33579 -- Specialized exception raised on forced update failures.Simon Charette
Raising DatabaseError directly made it harder than it should to differentiate between IntegrityError when a forced update resulted in no affected rows. Introducing a specialized exception allows for callers to more easily silence, log, or turn them update failures into user facing exceptions (e.g. 404s). Thanks Mariusz for the review.
2025-03-10Fixed #36066 -- Documented that Q objects can be used directly in annotations.samruddhiDharankar
2025-03-04Fixed #36128 -- Clarified auto-generated unique constraint on m2m through ↵Clifford Gama
models.
2025-03-03Fixed #35444 -- Added generic support for Aggregate.order_by.Chris Muthig
This moves the behaviors of `order_by` used in Postgres aggregates into the `Aggregate` class. This allows for creating aggregate functions that support this behavior across all database engines. This is shown by moving the `StringAgg` class into the shared `aggregates` module and adding support for all databases. The Postgres `StringAgg` class is now a thin wrapper on the new shared `StringAgg` class. Thank you Simon Charette for the review.
2025-02-20Clarified admonition in GeneratedField docs.Adam Zapletal
2025-02-18Refs #36005 -- Used datetime.UTC alias instead of datetime.timezone.utc.Mariusz Felisiak
datetime.UTC was added in Python 3.11.
2025-02-14Corrected wording in docs/ref/models/constraints.txt.Luke Cousins
2025-01-24Fixed ambiguous pronoun reference in docs/ref/models/fields.txt.Clifford Gama
2025-01-15Refs #35234 -- Removed CheckConstraint.check per deprecation timeline.Sarah Boyce
2025-01-15Refs #35060 -- Removed passing positional arguments to Model.save()/asave() ↵Sarah Boyce
per deprecation timeline.
2025-01-15Refs #34355 -- Removed support for positional arguments in BaseConstraint ↵Sarah Boyce
per deprecation timeline.
2025-01-15Removed versionadded/changed annotations for 5.1.Sarah Boyce
This also removes remaining versionadded/changed annotations for older versions.
2025-01-15Refs #36070 -- Referred to pk as an attribute when a composite primary key ↵Jacob Walls
is defined. This is to avoid confusion that a field is often associated with having a single associated database column.
2025-01-14Fixed #36051 -- Declared arity on aggregate functions.Jacob Walls
Follow-up to 4a66a69239c493c05b322815b18c605cd4c96e7c.
2025-01-14Fixed #36075 -- Documented how to introspect composite primary keys.Simon Charette
Document _meta.pk_fields and interactions between Field.primary_key and CompositePrimaryKey. Thanks Mariusz for the review.
2025-01-13Fixed #36077 -- Corrected docs on pk value where Model.save() executes an ↵Jacob Walls
UPDATE. The empty string is no longer special-cased since c2ba59fc1da5287d6286e2c2aca4083d5bafe056.
2025-01-07Refs #36042 -- Raised ValueError when providing composite expressions to ↵Jacob Walls
aggregates.
2025-01-06Fixed #35718 -- Add JSONArray to django.db.models.functions.John Parton
Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2024-12-16Refs #35718, Refs #32179 -- Moved JSONObject to django.db.models.functions.json.Sage Abdullah
2024-11-29Fixed #373 -- Added CompositePrimaryKey.Bendeguz Csirmaz
Thanks Lily Foote and Simon Charette for reviews and mentoring this Google Summer of Code 2024 project. Co-authored-by: Simon Charette <charette.s@gmail.com> Co-authored-by: Lily Foote <code@lilyf.org>
2024-10-30Fixed #35856 -- Added QuerySet.explain() support for MEMORY/SERIALIZE option ↵Anthony Joseph
on PostgreSQL 17+.
2024-10-29Corrected note on importing fields in model field reference docs.aruseni
2024-10-29Fixed typo in ref/models/fields.txt.Clifford Gama
2024-10-23Fixed #35731 -- Extended db_default docs.Yash
This added a missing db_default reference in docs/topics/db/models.txt, and added a reference to the DatabaseDefault object.
2024-10-17Fixed #26322 -- Consolidated lazy relationships details in ↵Clifford Gama
docs/ref/models/fields.txt. Reorganized docs to list and explain the types of lazy relationships that can be defined in related fields. Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
2024-10-10Fixed #35103 -- Used provided error code and message when fields is set ↵gabn88
without a condition on UniqueConstraint.
2024-09-19Fixed #35748 -- Documented that fields are excluded from a ModelForm when ↵Clifford Gama
formfield() returns None. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
2024-09-16Fixed #34887 -- Added support for unlimited models.CharField on SQLite.saJaeHyukc
Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
2024-09-09Refs #373 -- Added Model._is_pk_set() abstraction to check if a Model's PK ↵Csirmaz Bendegúz
is set.
2024-08-28Removed outdated note about lack of subquery support in MySQL.Adam Johnson
2024-08-28Fixed typo in docs/ref/models/expressions.txt.Mariusz Felisiak
2024-08-28Fixed typo in docs/ref/models/expressions.txt.Mariusz Felisiak
2024-08-20Fixed #35671 -- Clarified string-based fields behavior when null=False.Clifford Gama
2024-08-12Fixed #35586 -- Added support for set-returning database functions.Devin Cox
Aggregation optimization didn't account for not referenced set-returning annotations on Postgres. Co-authored-by: Simon Charette <charette.s@gmail.com>
2024-08-05Used :pypi: role in docs where appropriate.Mariusz Felisiak
2024-07-03Refs #28900 -- Made SELECT respect the order specified by values(*selected).Simon Charette
Previously the order was always extra_fields + model_fields + annotations with respective local ordering inferred from the insertion order of *selected. This commits introduces a new `Query.selected` propery that keeps tracks of the global select order as specified by on values assignment. This is crucial feature to allow the combination of queries mixing annotations and table references. It also allows the removal of the re-ordering shenanigans perform by ValuesListIterable in order to re-map the tuples returned from the database backend to the order specified by values_list() as they'll be in the right order at query compilation time. Refs #28553 as the initially reported issue that was only partially fixed for annotations by d6b6e5d0fd4e6b6d0183b4cf6e4bd4f9afc7bf67. Thanks Mariusz Felisiak and Sarah Boyce for review.