Changes between Version 1 and Version 2 of Ticket #25446, comment 1


Ignore:
Timestamp:
Sep 22, 2015, 2:42:09 PM (9 years ago)
Author:
Evan Heidtmann

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25446, comment 1

    v1 v2  
    99        from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
    1010
    11         sql = 'SELECT id FROM ride_segment WHERE line ~= {line_serialized} AND ST_OrderingEquals(line, {line_serialized})'.format(
    12             line_serialized=str(PostGISAdapter(line)))
     11       
    1312
    1413        # We have to run a query outside of Manager.raw() because Manager.raw()
     
    1716        from django.db import connection
    1817        with connection.cursor() as cursor:
     18            sql = 'SELECT id FROM ride_segment WHERE line ~= {line_serialized} AND ST_OrderingEquals(line, {line_serialized})'.format(
     19                line_serialized=str(PostGISAdapter(line)))
    1920            cursor.execute(sql)
    2021            ids = cursor.fetchmany()
Back to Top