o
    h                     @   s<   d dl mZ d dlmZ G dd deZG dd deZdS )    )Field)BaseSerializerc                   @   s    e Zd ZdZdd Zdd ZdS )ImageDownloadUrlFieldz|
    Serializes the "download_url" field for images.

    Example:
    "download_url": "/media/images/a_test_image.jpg"
    c                 C   s   |S N )selfinstancer   r   a/var/www/html/ndineBlogger/venv/lib/python3.10/site-packages/wagtail/images/api/v2/serializers.pyget_attribute   s   z#ImageDownloadUrlField.get_attributec                 C   s   |j jS r   )fileurl)r   imager   r   r	   to_representation   s   z'ImageDownloadUrlField.to_representationN)__name__
__module____qualname____doc__r
   r   r   r   r   r	   r      s    r   c                   @   s   e Zd ZeddZdS )ImageSerializerT)	read_onlyN)r   r   r   r   download_urlr   r   r   r	   r      s    r   N)rest_framework.fieldsr   wagtail.api.v2.serializersr   r   r   r   r   r   r	   <module>   s    