Changes between Version 1 and Version 2 of Ticket #25446, comment 1
- Timestamp:
- Sep 22, 2015, 2:42:09 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25446, comment 1
v1 v2 9 9 from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter 10 10 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 13 12 14 13 # We have to run a query outside of Manager.raw() because Manager.raw() … … 17 16 from django.db import connection 18 17 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))) 19 20 cursor.execute(sql) 20 21 ids = cursor.fetchmany()