Skip to content

Error debugging GeoDjango queries #423

Open
@rodrigoolmo

Description

@rodrigoolmo

When debugging queries that use GeoDjango they are parsed like normal strings.
Example:

params = [u"ST_GeomFromEWKB('\\x0101000020e6100000555458045a9d16c010470d5cd47c4440'::bytea)"]
sql = 'SELECT (ST_distance_sphere("location"."point",%s)) AS "distance" FROM "location"'

What it should execute:

SELECT (ST_distance_sphere("location"."point", ST_GeomFromEWKB('\x0101000020e6100000555458045a9d16c010470d5cd47c4440'::bytea))) AS "distance" FROM "location"

What it really executes:

SELECT (ST_distance_sphere("location"."point", 'ST_GeomFromEWKB(''\x0101000020e6100000555458045a9d16c010470d5cd47c4440''::bytea)')) AS "distance" FROM "location"

I am using django-debug-toolbar version 0.9.4, Django 1.4 and PostgreSQL with PostGIS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions