
    Bh>                     f    d dl mZ d dlmZ d dlZd dlmZmZ 	 d Z G d dej                        Z	y)    )unicode_literals)defaultdictN)
migrationsmodelsc                 L   | j                  dd      }| j                  dd      }| j                  dd      }|j                  j                  }|j                  j	                  |      j                  d      j                         j                  dd      }g }g }|D ]  }	|	j                  j                         D ]v  }
|	j                  j                         D ]W  } ||j                  |j                  |
j                  	      }|j                  |       |j                  |j                         Y x  |j                  j	                  |      j                  |       t!        t"              }|j                  j	                  |      j                  d
      }|j%                         D ]   }||j&                     j                  |       " |D ]  }	|	j                  j                         D ]  }||j                     }|D ]N  }|j                  j                  |j(                  |	|j                        j+                  |j                         P |j                  j-                  |         |j                  j	                  |      j                  |      j/                  t1        j2                  d            j5                  d      }|j                  d      j7                         rt9        j:                  dt<               |j                  d      j?                          y )NcmsPage	CMSPluginPlaceholderF)placeholders__isnullplaceholders	title_set)slotdefault_widthtitle_id)title_id__isnull)languageplaceholder__pageplaceholder__slot)placeholder_id)pk__in	cmsplugin)plugin_countpkr   )plugin_count__gtzThere's placeholders in your database with plugins in a language that's not configured These placeholders and its plugins are not in use and can be removed.) 	get_model
connectionaliasobjectsusingfilterdistinctprefetch_relatedr   allr   r   r   r   appendbulk_creater   listiteratorr   r   updatesetannotater   CountonlyexistswarningswarnUserWarningdelete)appsschema_editorr	   Pluginr   db_alias	cms_pagesnew_placeholdersold_placeholder_idspagetitleplaceholdernew_placeholderplaceholders_by_titlenew_placeholder_lookupnew_pltranslationold_placeholderss                     e/home/dcms/DCMS/lib/python3.12/site-packages/cms/migrations/0027_title_placeholders_data_migration.pyforwardsrD   !   s   >>%(D^^E;/F..6K''--H		x	U	+			.+	6   	;^^'') 	;E#00446 ;"-$))"-";";"XX#
 !''8#**;>>:;	;	; h'334DE (-		x		'	  )113 >foo.55f=>  ;>>--/ 	;K4[^^D#3 < %%(11&*&5&:&: &  &(:(:&;< $$(()9:	;;$ 			x	*	+	v||K8	9	d  299;T 		
 +224    c                   8    e Zd ZdgZ ej
                  e      gZy)	Migration)r   0026_title_placeholdersN)__name__
__module____qualname__dependenciesr   	RunPythonrD   
operations rE   rC   rG   rG   q   s'     	+L
 	
X&JrE   rG   )

__future__r   collectionsr   r/   	django.dbr   r   rD   rG   rO   rE   rC   <module>rS      s/    ' #  (4M5`
$$ rE   