î
ªÍ Xž  ã               @   sP   d  d l  m Z d  d l m Z d  d l m Z m Z Gd d „  d e ƒ Z d S)é    )Úunicode_literals)Ú
AppCommand)ÚDEFAULT_DB_ALIASÚconnectionsc                   s:   e  Z d  Z d Z d Z ‡  f d d †  Z d d „  Z ‡  S)ÚCommandzLPrints the SQL statements for resetting sequences for the given app name(s).Tc                s3   t  t |  ƒ j | ƒ | j d d t d d ƒd  S)Nz
--databaseÚdefaultÚhelpzNNominates a database to print the SQL for. Defaults to the "default" database.)Úsuperr   Úadd_argumentsÚadd_argumentr   )ÚselfÚparser)Ú	__class__© ú^/home/ubuntu/projects/ifolica/build/django/django/core/management/commands/sqlsequencereset.pyr
      s    zCommand.add_argumentsc             K   sX   | j  d  k r d  St | d } | j d d ƒ } | j j |  j | ƒ } d j | ƒ S)NZdatabaseZinclude_auto_createdTÚ
)Zmodels_moduler   Z
get_modelsÚopsZsequence_reset_sqlÚstyleÚ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   r   r   )r   r   r      s   r   N)Ú
__future__r   Zdjango.core.management.baser   Z	django.dbr   r   r   r   r   r   r   Ú<module>   s   