select_related() uses always QuerySet and Query classes from originating Model
|Reported by:||Jani Tiainen||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Cc:||Ian Kelly, Matt Boersma||Triage Stage:||Unreviewed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When having two models:
class ModelNormal(models.Model): geo = models.ForeignKey('ModelGeo') class ModelGeo(models.Model): geom = models.PointField() objects = models.GeoManager()
Accessing objects causes traceback because Django used Manager instead of GeoManager for GeoModel instance(s).
Further investigation indicated that QSL queries didn't have any decorators that GeoManager does for geometry fields needed in Oracle.
Change History (9)
comment:2 Changed 7 years ago by
|Component:||GIS → Database layer (models, ORM)|
|Keywords:||gis Oracle removed|
|Summary:||Mixing geo and nongeo with select_related() doesn't work with Oracle → select_related() uses always QuerySet and Query classes from originating Model|