
vÅÏ^²  ã               @   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)é    )ÚBaseCommand)Ú	sql_flush)ÚDEFAULT_DB_ALIASÚconnectionsc                   s:   e  Z d  Z d Z d Z ‡  f d d †  Z d d „  Z ‡  S)ÚCommandzŒReturns a list of the SQL statements required to return all tables in the database to the state they were in just after they were installed.Tc                s-   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.)ÚsuperÚadd_argumentsÚadd_argumentr   )ÚselfÚparser)Ú	__class__© úJ/tmp/pip-build-8lau8j11/django/django/core/management/commands/sqlflush.pyr
      s    zCommand.add_argumentsc             K   sT   t  |  j t | d d d ƒ} | rG | d d k rG |  j j d ƒ d j | ƒ S)NZdatabaseZonly_djangoTÚ	verbosityé   zNo tables found.Ú
)r   Ústyler   ÚstderrÚwriteÚjoin)r   ÚoptionsZsql_statementsr   r   r   Úhandle   s     zCommand.handle)Ú__name__Ú
__module__Ú__qualname__r   Zoutput_transactionr
   r   r   r   )r   r   r      s   r   N)Zdjango.core.management.baser   Zdjango.core.management.sqlr   Z	django.dbr   r   r   r   r   r   r   Ú<module>   s   