This removes unnecessary format('O') call, remove unnecessary method
calls for simple cases in TimeFormat, and simplifies time zone handling
in TimeFormat.
The Python's Steering Council decided to revert changes in the Enum
module (see https://bugs.python.org/issue44559) and moved them to
Python 3.11.
Follow up to 5d9b065d3f.
Thanks Nick Pope for the review.
"test --shuffle" skipped test methods when test classes were mixed.
This changes runner.py's reorder_tests() to group by TestCase class.
Regression in 90ba716bf0.
get_col() used "self" as "output_field" when it was not given, and
unnecessarily compared "self" to "self".
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Hardcoded pks are necessary for this test case, however we need to set
them for all new rows because the sequence will not increment
automatically. It works when the sequence is incremented by other
test cases.
This is useful when working with database routing as you want to know
where each query is being executed.
Co-authored-by: David Winterbottom <david.winterbottom@gmail.com>
The introduction of the Expression.empty_aggregate_value interface
allows the compilation stage to enable the EmptyResultSet optimization
if all the aggregates expressions implement it.
This also removes unnecessary RegrCount/Count.convert_value() methods.
Disabling the empty result set aggregation optimization when it wasn't
appropriate prevented None returned for a Count aggregation value.
Thanks Nick Pope for the review.
Migrations assumed that an import of the models.Model class must
already be included when it's serialized, but for models with only
custom fields this was not necessarily the case.
Thanks Jaap Joris Vens for the report.
By using a asgiref's ThreadSensitiveContext context manager, requests
will be able to execute independently of other requests when sync work
is involved.
Prior to this commit, a single global thread was used to execute any
sync work independent of the request from which that work was scheduled.
This could result in contention for the global sync thread in the case
of a slow sync function.
Requests are now isolated to their own sync thread.
Moved sections so that how-to type material is all together, and
renamed headings so it's clearer what those sections are about, in
anticipation of creating a separate how-to document and expanding
the material.