
    g.                     L    d dl mZ d dlmZmZ  G d de      Z G d de      Zy)    )OGRGeomType)DatabaseIntrospectionFlexibleFieldLookupDictc            	       @    e Zd ZdZi ej
                  ddddddddZy)GeoFlexibleFieldLookupDictzi
    Subclass that includes updates the `base_data_types_reverse` dict
    for geometry field types.
    GeometryField)point
linestringpolygon
multipointmultilinestringmultipolygongeometrycollectionN)__name__
__module____qualname____doc__r   base_data_types_reverse     /var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/contrib/gis/db/backends/spatialite/introspection.pyr   r      s7    
	
!
9
9	 %"%*'-	r   r   c                   2     e Zd Z e       Zd Z fdZ xZS )SpatiaLiteIntrospectionc                    | j                   j                         5 }|j                  d||j                  f       |j	                         }|st        d|d|j                  d      |d   }t        |t              r|dkD  r|dz  t        j                  z   }t        |      j                  }|d   }|d   }i }	|d	k7  r||	d
<   t        |t              rd|v s|dk(  rd|	d<   d d d        ||	fS # 1 sw Y   	fS xY w)NzpSELECT coord_dimension, srid, geometry_type FROM geometry_columns WHERE f_table_name=%s AND f_geometry_column=%sz&Could not find a geometry column for "z".""   i  r      i  sridZ   dim)
connectioncursorexecutenamefetchone	Exception
isinstanceintr   wkb25bitdjangostr)
self
table_namedescriptionr#   rowogr_type
field_typer!   r   field_paramss
             r   get_geometry_typez)SpatiaLiteIntrospection.get_geometry_type   s   __##%NNA [--.	 //#C!;#3#35  1vH(C(X_ $d?[-A-AA$X.55J a&Cq6DLt|'+V$3$q&'U#A &B <''C &B <''s   CC--C9c                     t         |   ||      }|j                  d|f       |j                         D ]  }|d   gddd ddd|d|d   z  <    |S )Nz`SELECT f_geometry_column FROM geometry_columns WHERE f_table_name=%s AND spatial_index_enabled=1r   FT)columnsprimary_keyuniqueforeign_keycheckindexz%s__spatial__index)superget_constraintsr$   fetchall)r-   r#   r.   constraintsr0   	__class__s        r   r=   z'SpatiaLiteIntrospection.get_constraintsA   sv    g-fjA@ M		
 ??$CF8$#:K,s1v56 % r   )r   r   r   r   data_types_reverser4   r=   __classcell__)r@   s   @r   r   r      s    35"(H r   r   N)django.contrib.gis.gdalr   (django.db.backends.sqlite3.introspectionr   r   r   r   r   r   r   <module>rE      s'    /!8 $83 8r   