<s> """<STR_LIT>""" <EOL> from django . contrib . gis . db . backend . postgis . query import GEOM_FROM_WKB <EOL> from psycopg2 import Binary <EOL> from psycopg2 . extensions import ISQLQuote <EOL> class PostGISAdaptor ( object ) : <EOL> def __init__ ( self , geom ) : <EOL> "<STR_LIT>" <EOL> self . wkb = str ( geom . wkb ) <EOL> self . srid = geom . srid <EOL> def __conform__ ( self , proto ) : <EOL> if proto == ISQLQuote : <EOL> return self <EOL> else : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def __eq__ ( self , other ) : <EOL> return ( self . wkb == other . wkb ) and ( self . srid == other . srid ) <EOL> def __str__ ( self ) : <EOL> return self . getquoted ( ) <EOL> def getquoted ( self ) : <EOL> "<STR_LIT>" <EOL> return "<STR_LIT>" % ( GEOM_FROM_WKB , Binary ( self . wkb ) , self . srid or - <NUM_LIT:1> ) </s>
