o
    h                     @   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.
    WAGTAILIMAGES_IMAGE_MODELzwagtailimages.Image)getattrr    r   r   W/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/images/__init__.pyget_image_model_string   s   r   c                  C   sR   ddl m}  t }z| j|ddW S  ty   td ty(   td| w )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)require_readyzDWAGTAILIMAGES_IMAGE_MODEL must be of the form 'app_label.model_name'zJWAGTAILIMAGES_IMAGE_MODEL refers to model '%s' that has not been installed)django.appsr	   r   	get_model
ValueErrorr   LookupError)r	   model_stringr   r   r   get_image_model   s   r   N)django.confr   django.core.exceptionsr   r   r   r   r   r   r   <module>   s    	