| Age | Commit message (Collapse) | Author |
|
The underlying unsafety with iterating F() expressions will be handled
later (#37384), to allow time to consider backward compatibility.
The underlying query should also not raise a ValueError (#37383), but
that likely will not be backported.
Thanks Pravin Kamble for the review.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
Many (~70) tests assert a specific row order for querysets whose SQL has no
ORDER BY. SQL standard does not define that order.
On PostgreSQL the rows usually arrive in physical storage order, which
on a freshly loaded table matches insertion order -- so these assertions
pass by coincidence rather than by contract. That breaks when rows are
updated or deleted and the space is reused, or when the planner picks a
different access path such as an index scan. A test like this can start
failing with no change to Django or to the test itself.
The patch made sure that most of these tests do not
rely on unspecified unordered selection order.
|
|
This ensures all database identifiers are quoted independently of their orign
and most importantly that user provided aliases through annotate() and alias()
which paves the way for dropping the allow list of characters such aliases can
contain.
This will require adjustments to raw SQL interfaces such as RawSQL that might
make reference to ORM managed annotations as these will now be quoted.
The `SQLCompiler.quote_name_unless_alias` method is kept for now as an alias
for the newly introduced `.quote_name` method but will be duly deprecated in
a follow up commit.
|
|
This change ensures that behavior and performance remain consistent when
traversing relationships.
|
|
ForeignObject.
Follow-up to e44e8327d3d88d86895735c0e427102063ff5b55. Refs #36222.
|
|
validation.
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
|
|
Just like the In() lookup discards of None members TupleIn() should
discard tuples containing any None as NULL != NULL in SQL and the
framework expects such queries to be elided under some circumstances.
Refs #31667, #36116.
Thanks Basptise Mispelon for bisecting the regression to 626d77e.
|
|
datetime.UTC was added in Python 3.11.
|
|
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.
|
|
Rely on ColPairs and TupleIn which support a single column to be specified
to avoid special casing ForwardManyToOne.get_prefetch_querysets().
Thanks Jacob Walls for the report.
|
|
methods per deprecation timeline.
|
|
sanity checks.
These checks are not backend-dependent.
|
|
|
|
|
|
|
|
|
|
Regression in 1eac690d25dd49088256954d4046813daa37dc95.
|
|
This also removed unreachable checks.
|
|
get_joining_columns()/get_reverse_joining_columns().
|
|
|
|
a query.
|
|
get_joining_columns()/get_reverse_joining_columns() methods.
|
|
relation on PostgreSQL.
|
|
Black 23.1.0 is released which, as the first release of the year,
introduces the 2023 stable style. This incorporates most of last year's
preview style.
https://github.com/psf/black/releases/tag/23.1.0
|
|
assertQuerySetEqual().
Co-Authored-By: Michael Howitz <mh@gocept.com>
|
|
Most QuerySet methods are mapped onto the Manager and, in general,
it isn't necessary to call .all() on the manager.
|
|
|
|
|
|
PathInfo values are ostensibly static over the lifetime of the object
for which they're requested, so the data can be memoized, quickly
amortising the cost over the process' duration.
|
|
Unused since 3caf957ed5eaa831a485abcb89f27266dbf3e82b.
|
|
- Replaced datetime.utcnow() with datetime.now().
- Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp().
- Replaced datetime.utctimetuple() with datetime.timetuple().
- Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
|
|
This also replaces assertQuerysetEqual() to
assertSequenceEqual()/assertCountEqual() where appropriate.
Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com>
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
|
|
|
|
|
|
Thanks Mariusz for suggesting it.
|
|
|
|
ForeignKey uses to_field.
Adjusted known related objects handling of target fields which relies on
from and to_fields and has the side effect of fixing a bug bug causing
N+1 queries when using reverse foreign objects.
Thanks Carsten Fuchs for the report.
|
|
It never worked and was never used.
|
|
|
|
support.
Thanks Anssi Kääriäinen for contributing to the patch.
|
|
* Removed all hardcoded logic for _{fieldname}_cache.
* Added an internal API for interacting with the field values cache.
Thanks carljm and MarkusH for support.
|
|
|
|
|
|
|
|
|
|
Python docs say, "it's usually not necessary to invoke these methods directly."
|
|
|