Django

Code

Ticket #13934 (closed: fixed)

Opened 2 months ago

Last modified 2 months ago

GeoSQLCompiler.get_default_columns() is missing local_only parameter

Reported by: sfllaw Assigned to: jbronn
Milestone: 1.3 Component: GIS
Version: 1.2 Keywords: select_related local_only get_default_columns GeoDjango GeoSQLCompiler
Cc: simon@akoha.com Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by jbronn)

If you try to select_related() with a GeoManager, things get pretty nasty with Django 1.2.

You get a TypeError, claiming that get_default_columns() does not support the local_only parameter.

Included is a patch that ports the functionality over.

Attachments

gis-local_only.patch (1.4 kB) - added by sfllaw on 07/14/10 09:58:23.
testapp.tar.gz (0.8 kB) - added by sfllaw on 07/15/10 15:07:03.

Change History

07/14/10 09:58:23 changed by sfllaw

  • attachment gis-local_only.patch added.

07/14/10 13:35:28 changed by jbronn

  • status changed from new to assigned.
  • needs_better_patch changed.
  • needs_tests changed.
  • milestone set to 1.3.
  • owner changed from nobody to jbronn.
  • needs_docs changed.

07/14/10 15:01:07 changed by jbronn

  • description changed.

Obviously, the code needs to be synced up. However, the existing tests for select_related aren't blowing up -- can you provide a simple example that raises the TypeError? I want to explicitly test for the condition that induces the failure to ensure it doesn't regress.

07/15/10 15:05:51 changed by sfllaw

Attached is a test app (with a test case) that breaks without my patch.

I'm not sure how to add this to django.contrib.gis, but I hope it helps.

07/15/10 15:07:03 changed by sfllaw

  • attachment testapp.tar.gz added.

07/20/10 14:05:46 changed by jbronn

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [13439]) Fixed #13934 -- GeoSQLCompiler.get_default_columns was missing local_only keyword argument. Thanks, Simon Law, for bug report and initial patch.

07/20/10 14:14:24 changed by jbronn

(In [13440]) [1.2.X] Fixed #13934 -- GeoSQLCompiler.get_default_columns was missing local_only keyword argument. Thanks, Simon Law, for bug report and initial patch.

Backport of r13439 from trunk.


Add/Change #13934 (GeoSQLCompiler.get_default_columns() is missing local_only parameter)




Change Properties
Action