| Age | Commit message (Collapse) | Author |
|
|
|
non-PostgreSQL databases.
|
|
get_placeholder_sql.
The lack of ability of the get_placeholder call chain to return SQL and
parameters separated so they can be mogrified by the backend at execution time
forced implementations to dangerously interpolate potentially user controlled
values.
The get_placeholder_sql name was chosen due to its proximity to the previous
method, but other options such as Field.as_sql were considered but ultimately
rejected due to its different input signature compared to Expression.as_sql
that might have lead to confusion.
There is a lot of overlap between what Field.get_db_prep_value and
get_placeholder_sql do but folding the latter in the former would require
changing its return signature to return expression which is a way more invasive
change than what is proposed here.
Given we always call get_db_prep_value it might still be an avenue worth
exploring in the future to offer a publicly documented interface to allow field
to take an active part in the compilation chain.
Thanks Jacob for the review.
|
|
on PostgreSQL.
|
|
|
|
Forwardport of 00575b79312c719a6b37035067095e2d679bb5d7 from stable/6.0.x.
|
|
|
|
|
|
This was missed when Field.check(databases) was introduced.
|
|
base_field.get_db_prep_save.
Previously, ArrayField always used base_field.get_db_prep_value when saving,
which could differ from how base_field prepares data for save. This change
overrides ArrayField.get_db_prep_save to delegate to the base_field's
get_db_prep_save, ensuring elements like None in JSONField arrays are saved
correctly as SQL NULL instead of JSON null.
|
|
|
|
Forwardport of 2a2936c3e6444a0f37156773ca405cedaf28dea7 from stable/5.2.x.
|
|
deprecation timeline.
|
|
This expression automatically escapes its input and allows
fine-grained control over prefix matching and term weighting
via logical combinations.
Thanks Mariusz Felisiak, Adam Zapletal, Paolo Melchiorre,
Jacob Walls, Adam Johnson, and Simon Charette for reviews.
Co-authored-by: joetsoi <joetsoi@users.noreply.github.com>
Co-authored-by: Karl Hobley <karl@kaed.uk>
Co-authored-by: Alexandr Tatarinov <tatarinov1997@gmail.com>
|
|
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
installed when using its features.
Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS
when using:
* PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField),
* PostgreSQL indexes (PostgresIndex and all subclasses), and
* ExclusionConstraint
The check provides immediate feedback during system checks rather than failing
later with obscure runtime and database errors.
Thanks to Simon Charette and Sarah Boyce for reviews.
|
|
|
|
|
|
Forwardport of cc31b389a11559396fc039511c0dc567d9ade469 from stable/5.2.x.
|
|
|
|
fields in condition.
Signed-off-by: saJaeHyukc <wogur981208@gmail.com>
|
|
This commit does not create any functional changes, but marks the
existing `OrderableAggMixin` class as deprecated so that developers
using it directly can be made aware of its future removal.
|
|
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.
|
|
constraints.
|
|
Aligns the argument with SQL standards already used in Window.order_by and
sets up for adding support to Aggregate.
|
|
|
|
HStoreField.
|
|
migrations.
|
|
Forwardport of e245f62d0052d7b15fa2a60926d59eeeefee9be1 from stable/5.1.x.
|
|
remove_trailing_nulls=True.
|
|
is set.
|
|
|
|
Forwardport of 380c6e6ddd7890fbe65826873579ef6e3af0c07d from stable/5.1.x.
|
|
_get_field_value_map() and renamed to _get_field_expression_map().
|
|
|
|
with OpClass().
This also introduces Expression.constraint_validation_compatible that
allows specifying that expression should be ignored during a constraint
validation.
|
|
|
|
Updated OrderableAggMixin.as_sql() to separate the order_by parameters
from the filter parameters. Previously, the parameters and SQL were
calculated by the Aggregate parent class, resulting in a mixture of
order_by and filter parameters.
Thanks Simon Charette for the review.
|
|
Refactored the filter and order_by expressions in the Aggregate class to
return a list of Expression (or None) values, ensuring that the list
item is always available and represents the filter expression.
For the PostgreSQL OrderableAggMixin, the returned list will always
include the filter and the order_by value as the last two elements.
Lastly, emtpy Q objects passed directly into aggregate objects using
Aggregate.filter in admin facets are filtered out when resolving the
expression to avoid errors in get_refs().
Thanks Simon Charette for the review.
|
|
ExclusionConstraint.expressions.
|
|
Forwardport of 3cc35aafabb1523c39332ee83e769b085ed3d923 from stable/5.0.x.
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
each operation.
|
|
|
|
Co-authored-by: Priyansh Saxena <askpriyansh@gmail.com>
Co-authored-by: Niclas Olofsson <n@niclasolofsson.se>
Co-authored-by: David Smith <smithdc@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Co-authored-by: Abhinav Yadav <abhinav.sny.2002@gmail.com>
|
|
This paves the way for making OrderByList a simple shim over
ExpressionList which requires at least a single item to be provided.
|
|
Forwardport of 8e1b820fa10d16664beb5d1ca2f5671891da1704 from stable/5.0.x.
|
|
JSONField & co.
Per deprecation timeline.
|