
 X                 @   sa   d  d l  m Z d  d l m Z d  d l m Z d d d d d  Z d d	   Z d
 d   Z d S)    )unicode_literals)apps)modelsFTc             C   ss   | r$ | j  j d d d d  } n | j  j d d  } | rN | j  j   n f  } | j j |  | | |  } | S)z
    Returns a list of the SQL statements used to flush the database.

    If only_django is True, then only table names that have associated Django
    models and are in INSTALLED_APPS will be included.
    Zonly_existingTZinclude_viewsF)ZintrospectionZdjango_table_namesZtable_namesZsequence_listops	sql_flush)style
connectionZonly_djangoZreset_sequencesZallow_cascadeZtablesZseqsZ
statements r	   H/home/ubuntu/projects/ifolica/build/django/django/core/management/sql.pyr      s    r   c             K   s   xz t  j   D]l } | j d  k r( q n  |  d k rH t d | j  n  t j j j d | d | d |  d | d | |  q Wd  S)N   z/Running pre-migrate handlers for application %ssender
app_config	verbosityinteractiveusing)	r   get_app_configsmodels_moduleprintlabelr   signalsZpre_migratesend)r   r   dbkwargsr   r	   r	   r
   emit_pre_migrate_signal   s    r   c             K   s   xz t  j   D]l } | j d  k r( q n  |  d k rH t d | j  n  t j j j d | d | d |  d | d | |  q Wd  S)Nr   z0Running post-migrate handlers for application %sr   r   r   r   r   )	r   r   r   r   r   r   r   Zpost_migrater   )r   r   r   r   r   r	   r	   r
   emit_post_migrate_signal(   s    r   N)	
__future__r   Zdjango.appsr   Z	django.dbr   r   r   r   r	   r	   r	   r
   <module>   s
   