a
    Lcòf%  ã                   @   s0   d dl mZ d dlmZmZ G dd„ deƒZdS )é    )Ú
AppCommand)ÚDEFAULT_DB_ALIASÚconnectionsc                       s,   e Zd ZdZdZ‡ fdd„Zdd„ Z‡  ZS )ÚCommandzLPrints the SQL statements for resetting sequences for the given app name(s).Tc                    s    t ƒ  |¡ |jdtdd� d S )Nz
--databasezNNominates a database to print the SQL for. Defaults to the "default" database.)ÚdefaultÚhelp)ÚsuperÚadd_argumentsÚadd_argumentr   )ÚselfÚparser©Ú	__class__© úm/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/django/core/management/commands/sqlsequencereset.pyr	      s    üzCommand.add_argumentsc                 K   s\   |j d u rd S t|d  }|jdd�}|j | j|¡}|sR|d dkrR| j d¡ d |¡S )NZdatabaseT)Zinclude_auto_createdÚ	verbosityé   zNo sequences found.Ú
)	Zmodels_moduler   Z
get_modelsÚopsZsequence_reset_sqlÚstyleÚstderrÚwriteÚjoin)r   Z
app_configÚoptionsÚ
connectionÚmodelsZ
statementsr   r   r   Úhandle_app_config   s    
zCommand.handle_app_config)Ú__name__Ú
__module__Ú__qualname__r   Zoutput_transactionr	   r   Ú__classcell__r   r   r   r   r      s
   ÿr   N)Zdjango.core.management.baser   Z	django.dbr   r   r   r   r   r   r   Ú<module>   s   