o
    h                     @   sb   d dl mZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 G dd deZedd	d Zd
S )    )settings)Model)gettext_lazy)hooks)Localec                   @   s   e Zd ZdZG dd dZdS )SimpleTranslationa"  
    SimpleTranslation, dummy model to create the `submit_translation` permission.

    We need this model to be concrete or the following management commands will misbehave:
    - `remove_stale_contenttypes`, will drop the perm
    - `dump_data`, will complain about the missing table
    c                   @   s   e Zd Zg ZdedfgZdS )zSimpleTranslation.Metasubmit_translationzCan submit translationsN)__name__
__module____qualname__default_permissions_permissions r   r   i/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/contrib/simple_translation/models.pyMeta   s    
r   N)r	   r
   r   __doc__r   r   r   r   r   r   	   s    r   after_create_pagec                 C   sD   t tddrtjj|jdD ]}||s|j|ddd qdS dS )a  Creates page aliases in other locales when a page is created.

    Whenever a page is created under a specific locale, this signal handler
    creates an alias page for that page under the other locales.

    e.g. When an editor creates the page "blog/my-blog-post" under the English
    tree, this signal handler creates an alias of that page called
    "blog/my-blog-post" under the other locales' trees.
    'WAGTAILSIMPLETRANSLATION_SYNC_PAGE_TREEF)pkT)copy_parentsaliasN)getattrr   r   objectsexclude	locale_idhas_translationcopy_for_translation)requestpagelocaler   r   r   r      s   
N)django.confr   django.db.modelsr   django.utils.translationr   r   wagtailr   wagtail.modelsr   r   registerr   r   r   r   r   <module>   s    