o
    h                     @   sL   d dl mZ d dlmZ d dlmZ d dlmZ dd ZG dd deZ	d	S )
    )apps)ContentType)BaseCommand)ReferenceIndexc                 C   s   | j  d| j S )N.)
__module____name__)model r
   q/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/management/commands/show_references_index.py
model_name   s   r   c                   @   s   e Zd Zdd ZdS )Commandc                 K   s   | j d d}tt dd dD ]9}t|sqdd |g|j  D }|d }|d }tj	j
||d	 }| j |d
dt|  ||7 }q| j d|  d S )NzReference index entries:r   c                 S   s   t | S )N)r   )mr
   r
   r   <lambda>   s    z Command.handle.<locals>.<lambda>)keyc                 S   s   g | ]
}t jj|d dqS )F)for_concrete_model)r   objectsget_for_model).0model_or_objectr
   r
   r   
<listcomp>   s    z"Command.handle.<locals>.<listcomp>)content_typebase_content_typez>6z  zTotal entries: )stdoutwritesortedr   
get_modelsr   
is_indexed_metaget_parent_listr   filtercountr   )selfoptionsobject_countr	   content_typesr   r   r"   r
   r
   r   handle   s$   

zCommand.handleN)r   r   __qualname__r'   r
   r
   r
   r   r      s    r   N)
django.appsr   "django.contrib.contenttypes.modelsr   django.core.management.baser   wagtail.modelsr   r   r   r
   r
   r
   r   <module>   s    