3
v^e                 @   s6   d dl mZ d dlmZ dddZdd Zd	d
 ZdS )    )apps)modelsFTc             C   sH   |r|j jddd}n|j jdd}|r2|j j nf }|jj| |||S )z
    Return a list of the SQL statements used to flush the database.

    If only_django is True, only include the table names that have associated
    Django models and are in INSTALLED_APPS .
    TF)Zonly_existinginclude_views)r   )introspectionZdjango_table_namesZtable_namessequence_listops	sql_flush)style
connectionZonly_djangoreset_sequencesallow_cascadetablesZseqs r   >/usr/lib/python3.6/site-packages/django/core/management/sql.pyr      s
    r   c          	   K   sX   xRt j D ]F}|jd krq
| dkr0td|j  tjjjf ||| ||d| q
W d S )N   z/Running pre-migrate handlers for application %s)sender
app_config	verbosityinteractiveusing)	r   get_app_configsmodels_moduleprintlabelr   signalspre_migratesend)r   r   dbkwargsr   r   r   r   emit_pre_migrate_signal   s    

r   c          	   K   sX   xRt j D ]F}|jd krq
| dkr0td|j  tjjjf ||| ||d| q
W d S )Nr   z0Running post-migrate handlers for application %s)r   r   r   r   r   )	r   r   r   r   r   r   r   post_migrater   )r   r   r   r   r   r   r   r   emit_post_migrate_signal%   s    

r!   N)FTF)django.appsr   	django.dbr   r   r   r!   r   r   r   r   <module>   s   
