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.
This allows the proper resolving of F("field__transform") when
performing constraint validation.
Thanks Tom Hall for the report and Sarah for the test.
Given there are no longer any internal usages of serialize=True and it
poses a risk to non-test databases integrity it seems appropriate to
deprecate it.
While the top-level objects fed to serialization are bound to the test
database being created nothing prevents code invoked during
serialization from performing queries against other connections entries
that haven't been swapped yet.
The reported example of that is a database router directing all reads to
a test mirror for a set of models involving auto-created many-to-many
fields. It might be tempting to address the many-to-many field case but
this a symptom of a larger problem where the test framework yields the
flow execution to user code that could interact with non-test databases
in unexpected ways.
Deferring test database fixture serialization until the point where all
connections entries have been swapped for their test equivalent ensures
that no code triggered during serialization can interact with non-test
databases.
Thanks Jake Howard for the report and Jacob Walls for the initial
investigation.
When Expression.__init__() overrides make use of *args, **kwargs
captures their argument values are respectively bound as a tuple and
dict instances. These composite values might themselves contain values
that require special identity treatments such as Concat(output_field)
as it's a Field instance.
Refs #30628 which introduced bound Field differentiation but lacked
argument captures handling.
Thanks erchenstein for the report.
xgettext only extracts comment blocks if there is no program code between
the comment and the string that gets extracted. For details, see:
https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html#Operation-mode
Black formatting has been turned off in some places to ensure the
comments are not moved, which previously resulted in them being removed
from the po files when scripts/manage_translations.py was run.
Non-tuple exact and in lookups have specialized logic for subqueries that can
be adapted to properly assign select mask if unspecified and ensure the number
of involved members are matching on both side of the operator.