
    VhM                     6    d dl mZ d dlmZmZ  G d de      Zy)    )
AppCommand)DEFAULT_DB_ALIASconnectionsc                   ,     e Zd ZdZdZ fdZd Z xZS )CommandzLPrints the SQL statements for resetting sequences for the given app name(s).Tc                 p    t         |   |       |j                  dt        t	        t
              d       y )Nz
--databasezNNominates a database to print the SQL for. Defaults to the "default" database.)defaultchoiceshelp)superadd_argumentsadd_argumentr   tupler   )selfparser	__class__s     `/home/dcms/DCMS/lib/python3.12/site-packages/django/core/management/commands/sqlsequencereset.pyr   zCommand.add_arguments   s6    f%$+& 	 	
    c                    |j                   y t        |d      }|j                  d      }|j                  j	                  | j
                  |      }|s#|d   dk\  r| j                  j                  d       dj                  |      S )NdatabaseT)include_auto_created	verbosity   zNo sequences found.
)	models_moduler   
get_modelsopssequence_reset_sqlstylestderrwritejoin)r   
app_configoptions
connectionmodels
statementss         r   handle_app_configzCommand.handle_app_config   s~    ##+ !45
&&D&A^^66tzz6J
gk2a7KK34yy$$r   )__name__
__module____qualname__r   output_transactionr   r(   __classcell__)r   s   @r   r   r      s    V 	 

%r   r   N)django.core.management.baser   	django.dbr   r   r    r   r   <module>r1      s    2 3%j %r   