a
    Dg                     @   s,   d dl mZ d dlmZ dd Zdd ZdS )    )settings)ImproperlyConfiguredc                   C   s   t tddS )z
    Get the dotted ``app.Model`` name for the image model as a string.
    Useful for developers making Wagtail plugins that need to refer to the
    image model, such as in foreign keys, but the model itself is not required.
    ZWAGTAILIMAGES_IMAGE_MODELzwagtailimages.Image)getattrr    r   r   V/var/www/lab.imftr.de/x/nb_venv/lib/python3.9/site-packages/wagtail/images/__init__.pyget_image_model_string   s    r   c                  C   s^   ddl m}  t }z| j|ddW S  ty<   tdY n tyX   td| Y n0 dS )z
    Get the image model from the ``WAGTAILIMAGES_IMAGE_MODEL`` setting.
    Useful for developers making Wagtail plugins that need the image model.
    Defaults to the standard ``wagtail.images.models.Image`` model
    if no custom model is defined.
    r   )appsF)Zrequire_readyzDWAGTAILIMAGES_IMAGE_MODEL must be of the form 'app_label.model_name'zJWAGTAILIMAGES_IMAGE_MODEL refers to model '%s' that has not been installedN)Zdjango.appsr   r   Z	get_model
ValueErrorr   LookupError)r   Zmodel_stringr   r   r   get_image_model   s    r   N)Zdjango.confr   Zdjango.core.exceptionsr   r   r   r   r   r   r   <module>   s   	