
    h                     >    d dl mZ d dlmZ ddlmZ  G d de      Zy)    )models)get_related_object   )SubcommandsCommandc                       e Zd ZdZdZd Zy)StaleReferencesz=Prints all stale references in the djangocms frontend pluginsstale_referencesc                    t         j                  j                  j                         D ]z  }|j                  j                         D ]Y  \  }}t        |t              sd|v sd|v s"t        |j                  |      }|;|j                   d|j                   d| d}|j                  j                  j                         }| j                  j                  | j                  j!                  |             |r[|D ]T  }	| j                  j                  | j                  j#                  d|	j$                   d|	j'                                       V | j                  j                  | j                  j#                  d|j                  j$                                \ } | j                  j                  | j                  j)                  d	             y )
Nmodelpkz (pk=z) stale field .z... on page #z, at z... in placeholder #zFinished checking references)r   FrontendUIItemobjectsallconfigitems
isinstancedictr   ui_itemr   placeholderpage_setstdoutwritestyleERRORWARNINGidget_absolute_urlSUCCESS)
selfargsoptionsr   keyvalueobjmsgpagespages
             s/home/dcms/DCMS/lib/python3.12/site-packages/djangocms_frontend/management/commands/subcommands/stale_references.pyhandlezStaleReferences.handle   s   ,,4488: 	wG%nn224 w
UeT*%'DEM0E;%,__$5U7::,nUXTYYZ"[C$+$7$7$@$@$D$D$FE KK--djj.>.>s.CD$,1 !&D$(KK$5$5(,

(:(:]477)SXY]YnYnYpXq;r(s%&!&
 !% 1 1$**2D2DG[\c\o\o\r\r[sEt2u vw	w" 	$**,,-KLM    N)__name__
__module____qualname__helpcommand_namer*    r+   r)   r   r      s    JD%LNr+   r   N)djangocms_frontendr   djangocms_frontend.helpersr   baser   r   r1   r+   r)   <module>r5      s    % 9 $N( Nr+   