File manager - Edit - /usr/local/CyberCP/lib/python3.10/site-packages/django/contrib/gis/db/backends/postgis/__pycache__/adapter.cpython-310.pyc
Back
o �h� � @ s: d Z ddlmZ ddlmZ ddlmZ G dd� d�ZdS )zL This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. � )�to_pgraster)�GEOSGeometry)�sqlc @ sJ e Zd Zddd�Zdd� Zdd� Zdd � Zd d� Zedd � �Z dd� Z dS )�PostGISAdapterFc C s@ t |ttf�| _| jrt|j�| _nt|�| _|j| _|| _dS )z3 Initialize on the spatial object. N) � isinstancer r �is_geometry�bytes�ewkbr �srid� geography)�self�objr � r �a/usr/local/CyberCP/lib/python3.10/site-packages/django/contrib/gis/db/backends/postgis/adapter.py�__init__ s zPostGISAdapter.__init__c C s ddl m} ||kr| S td��)z9Does the given protocol conform to what Psycopg2 expects?r )� ISQLQuotez<Error implementing psycopg2 protocol. Is psycopg2 installed?)�psycopg2.extensionsr � Exception)r �protor r r r �__conform__ s �zPostGISAdapter.__conform__c C s t |t�o | j|jkS �N)r r r )r �otherr r r �__eq__% s zPostGISAdapter.__eq__c C s t | j�S r )�hashr �r r r r �__hash__( s zPostGISAdapter.__hash__c C s | � � �� S r )� getquoted�decoder r r r �__str__+ s zPostGISAdapter.__str__c C s |S r r )�cls�polyr r r �_fix_polygon. s zPostGISAdapter._fix_polygonc C s: | j rd| jr dndt�| j��� f S d| j�� �� S )zP Return a properly quoted string for use in PostgreSQL/PostGIS. s %s(%s)s ST_GeogFromWKBs ST_GeomFromEWKBs '%s'::raster)r r r �quoter �encode�hexr r r r r 2 s �zPostGISAdapter.getquotedN)F)�__name__� __module__�__qualname__r r r r r �classmethodr! r r r r r r s r N)�__doc__�/django.contrib.gis.db.backends.postgis.pgrasterr �django.contrib.gis.geosr �)django.db.backends.postgresql.psycopg_anyr r r r r r �<module> s
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings