U
    ¡‹®g  ã                   @   s   d Z G dd„ dƒZdS )zL
A collection of utility routines and classes used by the spatial
backends.
c                   @   s2   e Zd ZdZdZd	dd„Zedd„ ƒZdd„ ZdS )
ÚSpatialOperatorzY
    Class encapsulating the behavior specific to a GIS operation (used by lookups).
    Nc                 C   s   || _ || _d S )N©ÚopÚfunc)Úselfr   r   © r   úH/tmp/pip-unpacked-wheel-ye1bytdm/django/contrib/gis/db/backends/utils.pyÚ__init__   s    zSpatialOperator.__init__c                 C   s   | j r
dS dS d S )Nz%(func)s(%(lhs)s, %(rhs)s)z%(lhs)s %(op)s %(rhs)s)r   )r   r   r   r   Údefault_template   s    z SpatialOperator.default_templatec                 C   s2   | j p|j p| j}| | j| jdœ¡ || |fS )Nr   )Úsql_templater	   Úupdater   r   )r   Ú
connectionÚlookupZtemplate_paramsZ
sql_paramsr
   r   r   r   Úas_sql   s    zSpatialOperator.as_sql)NN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
   r   Úpropertyr	   r   r   r   r   r   r      s   

r   N)r   r   r   r   r   r   Ú<module>   s   