a
    Døgõ  ã                   @   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   ú`/var/www/lab.imftr.de/x/nb_venv/lib/python3.9/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)Z	read_onlyN)r   r   r   r   Údownload_urlr   r   r   r	   r      s   r   N)Zrest_framework.fieldsr   Zwagtail.api.v2.serializersr   r   r   r   r   r   r	   Ú<module>   s   