Ë
    ¹ûàg·  ã                   óž   — d dl Z d dlmZ d dlmZmZ d dlmZ  G d„ de j                  «      Z	 G d„ de j                  «      Z
 G d	„ d
e«      Zy)é    N)Úgdal)ÚBaseCommandÚCommandError)Úget_func_argsc                   ó   — e Zd ZdZdd„Zy)ÚLayerOptionActionzy
    Custom argparse action for the `ogrinspect` `layer_key` keyword option
    which may be an integer or a string.
    Nc                 ó’   — 	 t        || j                  t        |«      «       y # t        $ r t        || j                  |«       Y y w xY w©N)ÚsetattrÚdestÚintÚ
ValueError©ÚselfÚparserÚ	namespaceÚvalueÚoption_strings        úo/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/django/contrib/gis/management/commands/ogrinspect.pyÚ__call__zLayerOptionAction.__call__   s:   € ð	1Ü�I˜tŸy™y¬#¨e«*Õ5øÜò 	1Ü�I˜tŸy™y¨%Ö0ð	1ús   ‚ # £ AÁAr
   ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   © ó    r   r   r      s   „ ñô
1r   r   c                   ó   — e Zd ZdZdd„Zy)ÚListOptionActionz®
    Custom argparse action for `ogrinspect` keywords that require
    a string list. If the string is 'True'/'true' then the option
    value will be a boolean instead.
    Nc                 ó¦   — |j                  «       dk(  rt        || j                  d«       y t        || j                  |j                  d«      «       y )NÚtrueTú,)Úlowerr   r   Úsplitr   s        r   r   zListOptionAction.__call__   s9   € Ø�;‰;‹=˜FÒ"Ü�I˜tŸy™y¨$Õ/ä�I˜tŸy™y¨%¯+©+°cÓ*:Õ;r   r
   r   r   r   r   r   r      s   „ ñô<r   r   c                   ó    — e Zd ZdZg Zd„ Zd„ Zy)ÚCommandz³Inspects the given OGR-compatible data source (e.g., a shapefile) and outputs
a GeoDjango model with the given model name. For example:
 ./manage.py ogrinspect zipcode.shp Zipcodec                 ó  — |j                  dd¬«       |j                  dd¬«       |j                  dt        dd¬	«       |j                  d
t        dd¬	«       |j                  ddd¬«       |j                  ddt        dd¬«       |j                  ddd¬«       |j                  dd¬«       |j                  dddd¬«       |j                  d t        dd!¬	«       |j                  d"d#¬«       |j                  d$dd%¬«       y )&NÚdata_sourcezPath to the data source.)ÚhelpÚ
model_namezName of the model to create.z--blankFz–Use a comma separated list of OGR field names to add the `blank=True` option to the field definition. Set to `true` to apply to all applicable fields.)ÚactionÚdefaultr)   z	--decimalzžUse a comma separated list of OGR float fields to generate `DecimalField` instead of the default `FloatField`. Set to `true` to apply to all OGR float fields.z--geom-nameÚgeomzDSpecifies the model name for the Geometry Field (defaults to `geom`))r,   r)   z--layerÚ	layer_keyr   zšThe key for specifying which layer in the OGR data source to use. Defaults to 0 (the first layer). May be an integer or a string identifier for the layer.)r   r+   r,   r)   z--multi-geomÚ
store_truez?Treat the geometry in the data source as a geometry collection.)r+   r)   z--name-fieldz:Specifies a field name to return for the __str__() method.z--no-importsÚstore_falseÚimportszDDo not include `from django.contrib.gis.db import models` statement.)r+   r   r)   z--nullz•Use a comma separated list of OGR field names to add the `null=True` option to the field definition. Set to `true` to apply to all applicable fields.z--sridzeThe SRID to use for the Geometry Field. If it can be determined, the SRID of the data source is used.z	--mappingz8Generate mapping dictionary for use with `LayerMapping`.)Úadd_argumentr   r   )r   r   s     r   Úadd_argumentszCommand.add_arguments,   sk  € Ø×Ñ˜MÐ0JÐÔKØ×Ñ˜LÐ/MÐÔNØ×ÑØÜ#Øð1ð	 	ô 	
ð 	×ÑØÜ#ØðLð	 	ô 	
ð 	×ÑØØØWð 	ô 	
ð
 	×ÑØØÜ$Øð?ð 	ô 	
ð 	×ÑØØØRð 	ô 	
ð
 	×ÑØØMð 	ô 	
ð 	×ÑØØ ØØWð	 	ô 	
ð 	×ÑØÜ#Øð1ð	 	ô 	
ð 	×ÑØð?ð 	ô 	
ð
 	×ÑØØØKð 	õ 	
r   c                 ó  ‡— |j                  d«      |j                  d«      }}	 t        j                  |«      }ddlm}m} |j                  «       D �	�
ci c]  \  }	}
|	t        |«      v r|
�|	|
“Œ }}	}
 |||fi |¤ŽD �cg c]  }|‘Œ }}|d   r²|d   |d   |d   d	œ} ||fi |¤Ž}|j                  «       D �	�
ci c]  \  }	}
|
|	“Œ
 c}
}	Š|j                  d
d
d|z  d|j                  «       z  g«       |j                  ˆfd„||d      j                  D «       «       |j                  d|d   ›d||d      ›d�dg«       dj                  |«      S # t        j                  $ r}t	        |«      ‚d }~ww xY wc c}
}	w c c}w c c}
}	w )Nr(   r*   r   )Ú_ogrinspectÚmappingr6   Ú	geom_namer.   Ú
multi_geom)r7   r.   r8   Ú z7# Auto-generated `LayerMapping` dictionary for %s modelz%s_mapping = {c              3   ó6   •K  — | ]  }d ‰|   ›d|›d�–— Œ y­w)ú    'ú': 'ú',Nr   )Ú.0Úogr_fldÚrev_mappings     €r   ú	<genexpr>z!Command.handle.<locals>.<genexpr>™   s#   øè ø€ ò áð &1°Ó%9º7ÔCñùs   ƒr;   r<   r=   ú}ú
)Úpopr   Ú
DataSourceÚGDALExceptionr   Ú#django.contrib.gis.utils.ogrinspectr5   r6   Úitemsr   Úextendr#   ÚfieldsÚjoin)r   ÚargsÚoptionsr(   r*   ÚdsÚmsgr5   r6   ÚkÚvÚogr_optionsÚsÚoutputÚkwargsÚmapping_dictr@   s                   @r   ÚhandlezCommand.handleo   sÈ  ø€ Ø")§+¡+¨mÓ"<¸g¿k¹kÈ,Ó>W�Zˆð	$Ü—‘ Ó-ˆB÷ 	Mð
  Ÿ™›÷
á��1Ø”M +Ó.Ñ.°1°=ð ˆq‰Dð
ˆñ 
ñ
 )¨¨ZÑG¸;ÑGÖH˜’!ÐHˆÐHà�9Òð % [Ñ1Ø$ [Ñ1Ø% lÑ3ñˆFñ
 # 2Ñ0¨Ñ0ˆLð -9×,>Ñ,>Ó,@×A¡D A q˜1˜a™4ÓAˆKØ�M‰MàØØMØ ñ!à$ z×'7Ñ'7Ó'9Ñ9ðôð �M‰Mó à! '¨+Ñ"6Ñ7×>Ñ>ôô ð �MŠMð ˜{Ó+¨\¸'À+Ñ:NÓ-OðQàðôð �y‰y˜Ó Ð øô_ ×!Ñ!ò 	$Ü˜sÓ#Ð#ûð	$üó
ùò
 Iùó Bs)   ¥E ÁE9Â 	E?Â;FÅE6Å&E1Å1E6N)r   r   r   r)   Úrequires_system_checksr3   rW   r   r   r   r&   r&   #   s    „ ð	6ð 	ð  ÐòA
óF5!r   r&   )ÚargparseÚdjango.contrib.gisr   Údjango.core.management.baser   r   Údjango.utils.inspectr   ÚActionr   r   r&   r   r   r   ú<module>r^      s?   ðÛ å #ß AÝ .ô
1˜Ÿ™ô 
1ô<�x—‘ô <ôA!ˆkõ A!r   