| Age | Commit message (Collapse) | Author |
|
Needed by Django MongoDB Backend's EmbeddedModelField.
|
|
own line.
|
|
This facilitates nested fields and objects.
|
|
Co-authored-by: Simon Charette <charette.s@gmail.com>
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
Deserializer.
Thanks Shai Berger and Natalia Bidart for reviews.
|
|
The only use case for visiting grandchild nodes turned out to be to
support an unintentionally invalid fixture in the test suite.
The invalid fixture added in #36969 was modeled on fixture9.xml in
dae08cf55b83caef5e8ee39b16417692e8565278, so that is corrected as well
in this commit, where the test will still pass.
|
|
None values in natural keys were incorrectly serialized as the string
"None", causing deserialization to fail for fields like UUIDField.
|
|
Only children at one level of depth need to be visited.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
Refactored serialization logic to allow models inheriting a natural_key()
method (e.g. AbstractBaseUser) to explicitly opt out of natural key
serialization by returning an empty tuple from the method.
Thanks Jonas Dittrich for the report.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
|
|
serializer.
Previously, `getInnerText()` recursively used `list.extend()` on strings,
which added each character from child nodes as a separate list element.
On deeply nested XML content, this caused the overall deserialization
work to grow quadratically with input size, potentially allowing
disproportionate CPU consumption for crafted XML.
The fix separates collection of inner texts from joining them, so that
each subtree is joined only once, reducing the complexity to linear in
the size of the input. These changes also include a mitigation for a
xml.dom.minidom performance issue.
Thanks Seokchan Yoon (https://ch4n3.kr/) for report.
Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
|
|
Rewrapped long docstrings and block comments to 79 characters + newline
using script from https://github.com/medmunds/autofix-w505.
|
|
|
|
many-to-many field that had a prefetch.
|
|
get_attname()/get_attname_column().
|
|
https://github.com/psf/black/releases/tag/24.1.0
|
|
without natural keys during serialization.
By using `select_related(None)` instead of `select_related()`, the
unnecessary joins are completely avoided. Note that the current tests
already covers the change, when the field is not `null=True`.
Regression in f9936deed1ff13b20e18bd9ca2b0750b52706b6c.
|
|
when base querysets use select_related().
Regression in 19e0587ee596debf77540d6a08ccb6507e60b6a7.
Thanks Martin Svoboda for the report.
|
|
natural keys.
|
|
|
|
Co-authored-by: Chason Chaffin <chason@gmail.com>
|
|
|
|
|
|
fixtures.
|
|
|
|
ordered attributes.
|
|
Model.pk was added after _get_pk_val() and many places weren't simplified.
|
|
Thanks Tim Graham for the review.
|
|
|
|
|
|
|
|
|
|
The smart_* version should only be used when a lazy string should keep
its lazy status.
|
|
deferred instance loading.
|
|
|
|
|
|
|
|
|
|
unserializable chars
Thanks Tim Graham for the review.
|
|
|
|
Thanks to gfairchild for the report and Claude for the review.
|
|
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.
In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
|
|
|
|
Thanks to Russell Keith-Magee for mentoring this Google Summer of
Code 2014 project and everyone else who helped with the patch!
|
|
|
|
|
|
Returning None on errors required unpythonic error checking and was
inconsistent with get_app_config.
get_model was a private API until the previous commit, but given that it
was certainly used in third party software, the change is explained in
the release notes.
Applied the same change to get_registered_model, which is a new private
API introduced during the recent refactoring.
|
|
Also renamed app_cache to apps and "app cache" to "app registry".
Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
|
|
Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
|
|
|
|
Since the original ones in django.db.models.loading were kept only for
backwards compatibility, there's no need to recreate them. However, many
internals of Django still relied on them.
They were also imported in django.db.models. They never appear in the
documentation, except a quick mention of get_models and get_app in the
1.2 release notes to document an edge case in GIS. I don't think that
makes them a public API.
This commit doesn't change the overall amount of global state but
clarifies that it's tied to the app_cache object instead of hiding it
behind half a dozen functions.
|