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m	Z	m
Z
mZmZmZmZmZmZmZ G dd„ dejƒZG dd	„ d	ejƒZG d
d„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZG dd„ dejƒZdS )é    )Úserializers)ÚgetLanguage)ÚlanguageKeyé   )ÚEducationContentÚEducationContentSocialMediaÚ#EducationContentSocialMediaLanguageÚ$EducationContentSocialMediaImageTextÚ,EducationContentSocialMediaImageTextLanguageÚ#EducationContentSocialMediaHashtagsÚ+EducationContentSocialMediaHashtagsLanguageÚEducationContentAppContentÚ"EducationContentAppContentLanguageÚ+EducationContentAppContentWhatYouShouldKnowÚ3EducationContentAppContentWhatYouShouldKnowLanguagec                   @   ó:   e Zd Ze ¡ Ze ¡ ZG dd„ dƒZdd„ Zdd„ Z	dS )ÚEducationContentSerializerc                   @   ó   e Zd ZeZg d¢ZdS )zEducationContentSerializer.Meta)ÚidÚcontentInformationIdÚsocialMediaListÚappContentListN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚfields© r   r   ú„/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/article/education_content/education_content_serializers.pyÚMeta   ó    r   c                 C   ó,   t | ƒ}tjj|jd�}t|t|idd�jS ©N)ÚeducationContentIdT©ÚcontextÚmany)r   r   ÚobjectsÚfilterr   Ú%EducationContentSocialMediaSerializerr   Údata©ÚselfÚinstanceÚ
languageIdÚdataListr   r   r   Úget_socialMediaList!   ó   ÿ
ÿþz.EducationContentSerializer.get_socialMediaListc                 C   r!   r"   )r   r   r'   r(   r   Ú$EducationContentAppContentSerializerr   r*   r+   r   r   r   Úget_appContentList*   r1   z-EducationContentSerializer.get_appContentListN)
r   r   r   r   ÚSerializerMethodFieldr   r   r   r0   r3   r   r   r   r   r      s    		r   c                   @   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 )r)   c                   @   r   )z*EducationContentSocialMediaSerializer.Meta)r   r#   Ú	postTitleÚcaptionÚctaÚimageTextListÚhashtagListN)r   r   r   r   r   r   r   r   r   r   r   ;   r    r   c                 C   ó<   t | ƒ}|d urtjj|j|d� ¡ }|d ur|jS d S d S ©N)ÚeducationContentSocialMediaIdr.   )r   r   r'   r(   r   Úfirstr5   ©r,   r-   r.   Útranslationr   r   r   Úget_postTitleG   ó   þýúz3EducationContentSocialMediaSerializer.get_postTitlec                 C   r:   r;   )r   r   r'   r(   r   r=   r6   r>   r   r   r   Úget_captionQ   rA   z1EducationContentSocialMediaSerializer.get_captionc                 C   r:   r;   )r   r   r'   r(   r   r=   r7   r>   r   r   r   Úget_cta[   rA   z-EducationContentSocialMediaSerializer.get_ctac                 C   r!   ©N)r<   Tr$   )r   r	   r'   r(   r   Ú.EducationContentSocialMediaImageTextSerializerr   r*   r+   r   r   r   Úget_imageTextListe   r1   z7EducationContentSocialMediaSerializer.get_imageTextListc                 C   r!   rD   )r   r   r'   r(   r   Ú-EducationContentSocialMediaHashtagsSerializerr   r*   r+   r   r   r   Úget_hashtagListn   r1   z5EducationContentSocialMediaSerializer.get_hashtagListN)r   r   r   r   r4   r5   r6   r7   r8   r9   r   r@   rB   rC   rF   rH   r   r   r   r   r)   4   s    


	r)   c                   @   ó   e Zd ZG dd„ dƒZdS )Ú-EducationContentSocialMediaLanguageSerializerc                   @   ó    e Zd ZeZdddddegZdS )z2EducationContentSocialMediaLanguageSerializer.Metar   r5   r6   r7   r<   N)r   r   r   r   r   r   r   r   r   r   r   r   y   ó    úr   N©r   r   r   r   r   r   r   r   rJ   x   ó    rJ   c                   @   ó*   e Zd Ze ¡ ZG dd„ dƒZdd„ ZdS )rE   c                   @   r   )z3EducationContentSocialMediaImageTextSerializer.Meta©r   ÚkeyNamer<   ÚtextN)r   r   r   r	   r   r   r   r   r   r   r   ˆ   r    r   c                 C   r:   ©N)Ú&educationContentSocialMediaImageTextIdr.   )r   r
   r'   r(   r   r=   rR   r>   r   r   r   Úget_text‘   rA   z7EducationContentSocialMediaImageTextSerializer.get_textN©r   r   r   r   r4   rR   r   rU   r   r   r   r   rE   …   ó    	rE   c                   @   rI   )Ú6EducationContentSocialMediaImageTextLanguageSerializerc                   @   ó   e Zd ZeZdddegZdS )z;EducationContentSocialMediaImageTextLanguageSerializer.Metar   rR   rT   N)r   r   r   r
   r   r   r   r   r   r   r   r   �   ó    ür   NrM   r   r   r   r   rX   œ   rN   rX   c                   @   rO   )rG   c                   @   r   )z2EducationContentSocialMediaHashtagsSerializer.MetarP   N)r   r   r   r   r   r   r   r   r   r   r   ª   r    r   c                 C   r:   rS   )r   r   r'   r(   r   r=   rR   r>   r   r   r   rU   ³   rA   z6EducationContentSocialMediaHashtagsSerializer.get_textNrV   r   r   r   r   rG   §   rW   rG   c                   @   rI   )Ú5EducationContentSocialMediaHashtagsLanguageSerializerc                   @   rY   )z:EducationContentSocialMediaHashtagsLanguageSerializer.Metar   rR   rT   N)r   r   r   r   r   r   r   r   r   r   r   r   ¿   rZ   r   NrM   r   r   r   r   r[   ¾   rN   r[   c                   @   sZ   e Zd 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S )r2   c                   @   r   )z)EducationContentAppContentSerializer.Meta)r   r#   ÚtitleÚintroductionÚimportantNoteÚwhatYouShouldKnowListN)r   r   r   r   r   r   r   r   r   r   r   Ï   r    r   c                 C   r:   ©N)ÚeducationContentAppContentIdr.   )r   r   r'   r(   r   r=   r\   r>   r   r   r   Ú	get_titleÚ   rA   z.EducationContentAppContentSerializer.get_titlec                 C   r:   r`   )r   r   r'   r(   r   r=   r]   r>   r   r   r   Úget_introductionä   rA   z5EducationContentAppContentSerializer.get_introductionc                 C   r:   r`   )r   r   r'   r(   r   r=   r^   r>   r   r   r   Úget_importantNoteî   rA   z6EducationContentAppContentSerializer.get_importantNotec                 C   r!   )N)ra   Tr$   )r   r   r'   r(   r   Ú5EducationContentAppContentWhatYouShouldKnowSerializerr   r*   r+   r   r   r   Úget_whatYouShouldKnowListø   r1   z>EducationContentAppContentSerializer.get_whatYouShouldKnowListN)r   r   r   r   r4   r\   r]   r^   r_   r   rb   rc   rd   rf   r   r   r   r   r2   É   s    


r2   c                   @   rI   )Ú,EducationContentAppContentLanguageSerializerc                   @   rK   )z1EducationContentAppContentLanguageSerializer.Metar   r\   r]   r^   ra   N)r   r   r   r   r   r   r   r   r   r   r   r     rL   r   NrM   r   r   r   r   rg     rN   rg   c                   @   r   )re   c                   @   r   )z:EducationContentAppContentWhatYouShouldKnowSerializer.Meta)r   rQ   ra   r\   ÚdescriptionN)r   r   r   r   r   r   r   r   r   r   r     r    r   c                 C   r:   ©N)Ú-educationContentAppContentWhatYouShouldKnowIdr.   )r   r   r'   r(   r   r=   r\   r>   r   r   r   rb     rA   z?EducationContentAppContentWhatYouShouldKnowSerializer.get_titlec                 C   r:   ri   )r   r   r'   r(   r   r=   rh   r>   r   r   r   Úget_description'  rA   zEEducationContentAppContentWhatYouShouldKnowSerializer.get_descriptionN)
r   r   r   r   r4   r\   rh   r   rb   rk   r   r   r   r   re     s    

re   c                   @   rI   )Ú=EducationContentAppContentWhatYouShouldKnowLanguageSerializerc                   @   s   e Zd ZeZddddegZdS )zBEducationContentAppContentWhatYouShouldKnowLanguageSerializer.Metar   r\   rh   rj   N)r   r   r   r   r   r   r   r   r   r   r   r   3  s    ûr   NrM   r   r   r   r   rl   2  rN   rl   N)Úrest_frameworkr   Úcommon.commonr   Úmama_care_api.settingsr   Úeducation_content_modelsr   r   r   r	   r
   r   r   r   r   r   r   ÚModelSerializerr   r)   rJ   rE   rX   rG   r[   r2   rg   re   rl   r   r   r   r   Ú<module>   s    4 D9#