summaryrefslogtreecommitdiff
path: root/django/db/models
AgeCommit message (Collapse)Author
2020-04-30Fixed #20581 -- Added support for deferrable unique constraints.Ian Foote
2020-04-27Removed unnecessary tuple wrapping of single format string argument.François Freitag
2020-04-24Refs #31369 -- Deprecated models.NullBooleanField in favor of ↵Tim Schilling
BooleanField(null=True).
2020-04-23Fixed #31500 -- Fixed detecting of unique fields in QuerySet.in_bulk() when ↵Hannes Ljungberg
using Meta.constraints. Detection of unique fields now takes into account non-partial unique constraints.
2020-04-22Avoided unnecessary recompilation of ordering clause regex in SQLCompiler.Adam Johnson
2020-04-20Fixed #31474 -- Made QuerySet.delete() not return the number of deleted ↵Hasan Ramezani
objects if it's zero.
2020-04-15Fixed #31223 -- Added __class_getitem__() to Manager and QuerySet.sobolevn
2020-04-10Fixed #31351 -- Added system checks for partial indexes and unique ↵Ichlasul Affan
constraints support.
2020-04-08Fixed #28184 -- Allowed using a callable for FileField and ImageField storage.miigotu
2020-04-07Refs #27666 -- Ensured relationship consistency on delayed reloads.Simon Charette
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>
2020-04-06Fixed #31426 -- Added proper field validation to QuerySet.order_by().Simon Charette
Resolve the field reference instead of using fragile regex based string reference validation.
2020-04-06Refs #7098 -- Deprecated passing raw column aliases to order_by().Simon Charette
Now that order_by() has expression support passing RawSQL() can achieve the same result. This was also already supported through QuerySet.extra(order_by) for years but this API is more or less deprecated at this point.
2020-04-06Fixed #31420 -- Fixed crash when filtering subquery annotation against a ↵Hasan Ramezani
SimpleLazyObject. Thanks Simon Charette for the solution and analysis.
2020-04-04Fixed #31415 -- Fixed crash when nested OuterRef is used with operators or ↵Hasan Ramezani
in database functions.
2020-04-01Refs #12990 -- Moved PostgresSimpleLookup to the ↵Mariusz Felisiak
django.db.models.lookups.PostgresOperatorLookup.
2020-03-31Refs #31403 -- Made SQLInsertCompiler.execute_sql() always return an ↵Adam Johnson
iterable of rows. List of tuples.
2020-03-25Fixed #23916 -- Allowed makemigrations to handle related model name case ↵Adam Johnson
changes. Made autodetector ignore related model name case changes so unnecessary migrations are not created.
2020-03-25Fixed #31396 -- Added binary XOR operator to F expressions.Hannes Ljungberg
2020-03-25Fixed #31377 -- Disabled grouping by aliases on ↵Hasan Ramezani
QuerySet.values()/values_list() when they collide with field names. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Thanks Holovashchenko Vadym for the report.
2020-03-20Refs #29724 -- Added is_dst parameter to QuerySet.datetimes().Hasan Ramezani
Thanks Simon Charette for the review and Mariusz Felisiak for tests.
2020-03-19Fixed #31285 -- Fixed inherited Meta.ordering of "-pk".Jon Dufresne
2020-03-18Refs #31055 -- Made long column names checks support databases aware.Mariusz Felisiak
2020-03-18Fixed #31376 -- Optimized nulls ordering when possible on SQLite and MySQL.Simon Charette
Both backends order NULLs first on ascending ordering and last on descending ordering which makes ORDER BY IS (NOT)? NULL wasteful when asc(nulls_first) and desc(nulls_last) are used since it prevents indice usage.
2020-03-05Fixed #29129 -- Skipped UPDATE when adding a model instance with inherited ↵Abhijeet Viswa
primary key that has a default.
2020-03-05Fixed #31327 -- Deprecated providing_args argument for Signal.Jon Dufresne
2020-03-03Fixed #31150 -- Included subqueries that reference related fields in GROUP ↵Mariusz Felisiak
BY clauses. Thanks Johannes Hoppe for the report. Regression in fb3f034f1c63160c0ff13c609acd01c18be12f80. Co-authored-by: Simon Charette <charette.s@gmail.com>
2020-02-28Fixed #31310 -- Fixed hints in checks for using intermediate model with ↵Matheus Cunha Motta
ambiguous foreign key. symmetrical=False is not required since 87b1ad6e7351464c60e751b483d9dfce3a2d3382.
2020-02-27Fixed #31251 -- Disabled grouping by OuterRef() annotation.Rohit
2020-02-27Fixed #31185 -- Fixed detecting of unique fields in ForeignKey/ForeignObject ↵Valze
checks when using Meta.constraints.
2020-02-24Fixed #31286 -- Made database specific fields checks databases aware.Taoup
Follow up to 0b83c8cc4db95812f1e15ca19d78614e94cf38dd.
2020-02-19Refs #31187 -- Added total_unique_constraints property to model's Options.Mariusz Felisiak
2020-02-18Refs #31282 -- Clarified M2O add/remove/set with PK behaviour.Carlton Gibson
Improved error message for remove() and added tests.
2020-02-17Fixed #31277 -- Relaxed system check of m2m intermediary tables for db_table ↵Xavier Francisco
collision when database routers are installed. Turned the error into a warning when database routers are installed.
2020-02-11Fixed #31246 -- Fixed locking models in QuerySet.select_for_update(of=()) ↵Abhijeet Viswa
for related fields and parent link fields with multi-table inheritance. Partly regression in 0107e3d1058f653f66032f7fd3a0bd61e96bf782.
2020-02-07Fixed #31055 -- Made constraint checks support databases aware.Simon Charette
2020-02-06Fixed #31233 -- Closed database connections and cursors after use.Jon Dufresne
2020-02-05Fixed #26813 -- Prevented empty choice in ModelChoiceField with RadioSelect ↵Hasan Ramezani
for fields with blank=False.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-02-03Fixed #31217 -- Made QuerySet.values()/values_list() group by not selected ↵Mariusz Felisiak
annotations with aggregations used in order_by(). Regression in 59b4e99dd00b9c36d56055b889f96885995e4240. Thanks Jon Dufresne for the report and Simon Charette for the review.
2020-01-31Cached ForeignObject.(local/foreign/reverse)_related_fields properties.Adam Johnson
2020-01-31Fixed 31207 -- Prevented references to non-local remote fields in ↵Hasan Ramezani
ForeignKey.to_field. Thanks Simon Charette for the initial patch and review.
2020-01-31Fixed #31219 -- Fixed object deletion crash for nested protected related ↵Matthias Kestenholz
objects.
2020-01-29Simplified DeferredAttribute.__get__() a bit.Taoup
2020-01-29Used model's Options.label/label_lower where applicable.Mariusz Felisiak
2020-01-29Refs #27852 -- Fixed object deletion to show all restricted related objects ↵Hasan Ramezani
rather than just the first one.
2020-01-29Refs #27852 -- Renamed a loop variable in Collector.collect() to avoid ↵Mariusz Felisiak
redefinition.
2020-01-27Refs #27852 -- Fixed object deletion to show all protected related objects ↵Hasan Ramezani
rather than just the first one. Thanks Anton Samarchyan for the initial patch.
2020-01-20Changed re-raising an exception to use bare raise syntax where appropriate.Jon Dufresne
2020-01-16Used constant instead of hard-coded value for recursive relationship.Adam Johnson
2020-01-16Fixed #29998 -- Allowed multiple OneToOneFields to the parent model.Mariusz Felisiak
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.