#28341: GeometryField doesn't create GEOSGeometry objects lazily anymore
-------------------------------------+-------------------------------------
Reporter: Sergey Fedoseev | Owner: Abhimanyu
| Singh Negi
Type: Bug | Status: assigned
Component: GIS | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Abhimanyu Singh Negi):
I have opened a pr addressing this
issue(https://github.com/django/django/pull/20687)
During my investigation I confirmed that GeometryField values were being
converted to GEOSGeometry obejcts, and Spatial proxy never receives the
values the loading is bypassed
What i tried to do was to try distinguish model instance coming from
values( queries ) so that raw WKB can be returned for model feilds, but
due to lack of enogh query context they couldnt be distinuished properly
so i tried a diffrent approach, the backend converters return raw db
values and the lazy conversion is handeled as intended by Spatial Proxy.
So the values(), values_list(), annotations, and aggreagates are
explicitly converted at result part, where the query context and output
feilds are there.
So this restores the lazy loading while keeping the existing behaviour of
the values() and aggregation queries.
Note: setting up and running the GIS tests required installing
GDAL/PostGIS locally, and some GIS related jobs are failing in the CI, any
guidance on how to fix that would be appriciated
--
Ticket URL: <https://code.djangoproject.com/ticket/28341#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019c589ee723-05e02d20-2185-4e92-ac69-f06a69377a90-000000%40eu-central-1.amazonses.com.