o
    ­Tïj  ã                   @   s\   d dl mZ d dlmZ d dlmZ ddlmZmZ G dd„ dej	ƒZ
G dd	„ d	ej	ƒZd
S )é    )Úserializers)ÚgetLanguage)ÚlanguageKeyé   )ÚTipQuoteÚTipQuoteLanguagec                   @   sj   e Zd Ze ¡ Ze ¡ Ze ¡ Ze ¡ Ze ¡ Z	G dd„ dƒZ
dd„ Zdd„ Zdd„ Zd	d
„ Zdd„ ZdS )ÚTipQuoteSerializerc                   @   s   e Zd ZeZg d¢ZdS )zTipQuoteSerializer.Meta)ÚidÚcontentInformationIdÚtipTitleÚtipÚtipExplanationÚquoteÚctaN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚfields© r   r   út/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/article/tip_quote/tip_quote_serializers.pyÚMeta   s    r   c                 C   ó<   t | ƒ}|d urtjj|j|d� ¡ }|d ur|jS d S d S ©N)Ú
tipQuoteIdÚ
languageId)r   r   ÚobjectsÚfilterr	   Úfirstr   ©ÚselfÚinstancer   Útranslationr   r   r   Úget_tipTitle   ó   þýúzTipQuoteSerializer.get_tipTitlec                 C   r   r   )r   r   r   r   r	   r   r   r   r   r   r   Úget_tip(   r$   zTipQuoteSerializer.get_tipc                 C   r   r   )r   r   r   r   r	   r   r   r   r   r   r   Úget_tipExplanation2   r$   z%TipQuoteSerializer.get_tipExplanationc                 C   r   r   )r   r   r   r   r	   r   r   r   r   r   r   Ú	get_quote<   r$   zTipQuoteSerializer.get_quotec                 C   r   r   )r   r   r   r   r	   r   r   r   r   r   r   Úget_ctaF   r$   zTipQuoteSerializer.get_ctaN)r   r   r   r   ÚSerializerMethodFieldr   r   r   r   r   r   r#   r%   r&   r'   r(   r   r   r   r   r      s    



r   c                   @   s   e Zd ZG dd„ dƒZdS )ÚTipQuoteLanguageSerializerc                   @   s$   e Zd ZeZdddddddegZdS )	zTipQuoteLanguageSerializer.Metar	   r   r   r   r   r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   R   s    ør   N)r   r   r   r   r   r   r   r   r*   Q   s    r*   N)Úrest_frameworkr   Úcommon.commonr   Úmama_care_api.settingsr   Útip_quote_modelsr   r   ÚModelSerializerr   r*   r   r   r   r   Ú<module>   s    F