#34344: PostGIS Database Backend Overrides features_class, ops_class and
introspection_class
-------------------------------------+-------------------------------------
Reporter: davidjayb | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: GIS | Version: dev
Severity: Normal | Keywords: geodjango postgis
Triage Stage: | database backend
Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
While working on adding PostGIS support to the django-multitenant library
I had some issues with the features_class that was overridden in the
DatabaseWrapper subclass. After some troubleshooting I was able to
determine this is because the PostGIS backend explicitly sets the
`features`, `ops`, and `introspection` properties to the file local
classes:
https://github.com/django/django/blob/stable/4.2.x/django/contrib/gis/db/backends/postgis/base.py#L91
I was able to work around this behaviour by overriding the constructor and
setting the features property explicitly:
https://github.com/citusdata/django-multitenant/pull/150/files#diff-
0d077af5d4e86f31f478785458ea6a03768a15aea077f49b9a79ffca8b0fe4beR37
This isn't very intuitive as other database backends will respect setting
the `_class` properties to instantiate classes.
--
Ticket URL: <https://code.djangoproject.com/ticket/34344>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/010701865c29e59d-9f9326a5-f3ba-4fc3-b8f1-73d1e5dfdf98-000000%40eu-central-1.amazonses.com.