o
    ­TïjO7  ã                   @   sN  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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G dd„ dejƒZ G dd„ dejƒZ!d S )!é    )Úserializers)ÚgetLanguage)ÚlanguageKeyé   )ÚProblemSolutionContentÚ!ProblemSolutionContentSocialMediaÚ)ProblemSolutionContentSocialMediaLanguageÚ*ProblemSolutionContentSocialMediaImageTextÚ2ProblemSolutionContentSocialMediaImageTextLanguageÚ)ProblemSolutionContentSocialMediaHashtagsÚ1ProblemSolutionContentSocialMediaHashtagsLanguageÚ ProblemSolutionContentAppContentÚ(ProblemSolutionContentAppContentLanguageÚ.ProblemSolutionContentAppContentPossibleCausesÚ6ProblemSolutionContentAppContentPossibleCausesLanguageÚ4ProblemSolutionContentAppContentRecommendedSolutionsÚ<ProblemSolutionContentAppContentRecommendedSolutionsLanguagec                   @   ó:   e Zd Ze ¡ Ze ¡ ZG dd„ dƒZdd„ Zdd„ Z	dS )Ú ProblemSolutionContentSerializerc                   @   ó   e Zd ZeZg d¢ZdS )z%ProblemSolutionContentSerializer.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/problem_solution_content/problem_solution_content_serializers.pyÚMeta   ó    r!   c                 C   ó,   t | ƒ}tjj|jd�}t|t|idd�jS ©N)ÚproblemSolutionContentIdT©ÚcontextÚmany)r   r   ÚobjectsÚfilterr   Ú+ProblemSolutionContentSocialMediaSerializerr   Údata©ÚselfÚinstanceÚ
languageIdÚdataListr   r   r    Úget_socialMediaList#   ó   ÿ
ÿþz4ProblemSolutionContentSerializer.get_socialMediaListc                 C   r#   r$   )r   r   r)   r*   r   Ú*ProblemSolutionContentAppContentSerializerr   r,   r-   r   r   r    Úget_appContentList,   r3   z3ProblemSolutionContentSerializer.get_appContentListN)
r   r   r   r   ÚSerializerMethodFieldr   r   r!   r2   r5   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   )z0ProblemSolutionContentSocialMediaSerializer.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)Ú#problemSolutionContentSocialMediaIdr0   )r   r   r)   r*   r   Úfirstr7   ©r.   r/   r0   Útranslationr   r   r    Úget_postTitleI   ó   þýúz9ProblemSolutionContentSocialMediaSerializer.get_postTitlec                 C   r<   r=   )r   r   r)   r*   r   r?   r8   r@   r   r   r    Úget_captionS   rC   z7ProblemSolutionContentSocialMediaSerializer.get_captionc                 C   r<   r=   )r   r   r)   r*   r   r?   r9   r@   r   r   r    Úget_cta]   rC   z3ProblemSolutionContentSocialMediaSerializer.get_ctac                 C   r#   ©N)r>   Tr&   )r   r	   r)   r*   r   Ú4ProblemSolutionContentSocialMediaImageTextSerializerr   r,   r-   r   r   r    Úget_imageTextListg   r3   z=ProblemSolutionContentSocialMediaSerializer.get_imageTextListc                 C   r#   rF   )r   r   r)   r*   r   Ú3ProblemSolutionContentSocialMediaHashtagsSerializerr   r,   r-   r   r   r    Úget_hashtagListp   r3   z;ProblemSolutionContentSocialMediaSerializer.get_hashtagListN)r   r   r   r   r6   r7   r8   r9   r:   r;   r!   rB   rD   rE   rH   rJ   r   r   r   r    r+   6   s    


	r+   c                   @   ó   e Zd ZG dd„ dƒZdS )Ú3ProblemSolutionContentSocialMediaLanguageSerializerc                   @   s    e Zd ZeZdddddegZdS )z8ProblemSolutionContentSocialMediaLanguageSerializer.Metar   r7   r8   r9   r>   N)r   r   r   r   r   r   r   r   r   r   r    r!   {   s    úr!   N©r   r   r   r!   r   r   r   r    rL   z   ó    rL   c                   @   ó*   e Zd Ze ¡ ZG dd„ dƒZdd„ ZdS )rG   c                   @   r   )z9ProblemSolutionContentSocialMediaImageTextSerializer.Meta)r   ÚkeyNameÚtyper>   ÚtextN)r   r   r   r	   r   r   r   r   r   r    r!   Š   r"   r!   c                 C   r<   )N)Ú,problemSolutionContentSocialMediaImageTextIdr0   )r   r
   r)   r*   r   r?   rR   r@   r   r   r    Úget_text”   rC   z=ProblemSolutionContentSocialMediaImageTextSerializer.get_textN©r   r   r   r   r6   rR   r!   rT   r   r   r   r    rG   ‡   s    
rG   c                   @   rK   )Ú<ProblemSolutionContentSocialMediaImageTextLanguageSerializerc                   @   ó   e Zd ZeZdddegZdS )zAProblemSolutionContentSocialMediaImageTextLanguageSerializer.Metar   rR   rS   N)r   r   r   r
   r   r   r   r   r   r   r    r!       ó    ür!   NrM   r   r   r   r    rV   Ÿ   rN   rV   c                   @   rO   )rI   c                   @   r   )z8ProblemSolutionContentSocialMediaHashtagsSerializer.Meta)r   rP   r>   rR   N)r   r   r   r   r   r   r   r   r   r    r!   ­   r"   r!   c                 C   r<   )N)Ú+problemSolutionContentSocialMediaHashtagsIdr0   )r   r   r)   r*   r   r?   rR   r@   r   r   r    rT   ¶   rC   z<ProblemSolutionContentSocialMediaHashtagsSerializer.get_textNrU   r   r   r   r    rI   ª   s    	rI   c                   @   rK   )Ú;ProblemSolutionContentSocialMediaHashtagsLanguageSerializerc                   @   rW   )z@ProblemSolutionContentSocialMediaHashtagsLanguageSerializer.Metar   rR   rY   N)r   r   r   r   r   r   r   r   r   r   r    r!   Â   rX   r!   NrM   r   r   r   r    rZ   Á   rN   rZ   c                   @   sz   e Zd Ze ¡ 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d„ ZdS )r4   c                   @   r   )z/ProblemSolutionContentAppContentSerializer.Meta)r   r%   ÚtitleÚproblemDescriptionÚwhenToSeekMedicalHelpÚimportantNoteÚpossibleCauseListÚrecommendedSolutionListN)r   r   r   r   r   r   r   r   r   r    r!   Ô   r"   r!   c                 C   r<   ©N)Ú"problemSolutionContentAppContentIdr0   )r   r   r)   r*   r   r?   r[   r@   r   r   r    Ú	get_titleá   rC   z4ProblemSolutionContentAppContentSerializer.get_titlec                 C   r<   ra   )r   r   r)   r*   r   r?   r\   r@   r   r   r    Úget_problemDescriptionë   rC   zAProblemSolutionContentAppContentSerializer.get_problemDescriptionc                 C   r<   ra   )r   r   r)   r*   r   r?   r]   r@   r   r   r    Úget_whenToSeekMedicalHelpõ   rC   zDProblemSolutionContentAppContentSerializer.get_whenToSeekMedicalHelpc                 C   r<   ra   )r   r   r)   r*   r   r?   r^   r@   r   r   r    Úget_importantNoteÿ   rC   z<ProblemSolutionContentAppContentSerializer.get_importantNotec                 C   r#   ©N)rb   Tr&   )r   r   r)   r*   r   Ú8ProblemSolutionContentAppContentPossibleCausesSerializerr   r,   r-   r   r   r    Úget_possibleCauseList	  r3   z@ProblemSolutionContentAppContentSerializer.get_possibleCauseListc                 C   r#   rg   )r   r   r)   r*   r   Ú>ProblemSolutionContentAppContentRecommendedSolutionsSerializerr   r,   r-   r   r   r    Úget_recommendedSolutionList  r3   zFProblemSolutionContentAppContentSerializer.get_recommendedSolutionListN)r   r   r   r   r6   r[   r\   r]   r^   r_   r`   r!   rc   rd   re   rf   ri   rk   r   r   r   r    r4   Ì   s    



	r4   c                   @   rK   )Ú2ProblemSolutionContentAppContentLanguageSerializerc                   @   s"   e Zd ZeZddddddegZdS )z7ProblemSolutionContentAppContentLanguageSerializer.Metar   r[   r\   r]   r^   rb   N)r   r   r   r   r   r   r   r   r   r   r    r!     s    ùr!   NrM   r   r   r   r    rl     rN   rl   c                   @   r   )rh   c                   @   r   )z=ProblemSolutionContentAppContentPossibleCausesSerializer.Meta©r   rP   rb   r[   ÚdescriptionN)r   r   r   r   r   r   r   r   r   r    r!   .  r"   r!   c                 C   r<   ©N)Ú0problemSolutionContentAppContentPossibleCausesIdr0   )r   r   r)   r*   r   r?   r[   r@   r   r   r    rc   8  rC   zBProblemSolutionContentAppContentPossibleCausesSerializer.get_titlec                 C   r<   ro   )r   r   r)   r*   r   r?   rn   r@   r   r   r    Úget_descriptionB  rC   zHProblemSolutionContentAppContentPossibleCausesSerializer.get_descriptionN©
r   r   r   r   r6   r[   rn   r!   rc   rq   r   r   r   r    rh   *  ó    

rh   c                   @   rK   )Ú@ProblemSolutionContentAppContentPossibleCausesLanguageSerializerc                   @   ó   e Zd ZeZddddegZdS )zEProblemSolutionContentAppContentPossibleCausesLanguageSerializer.Metar   r[   rn   rp   N)r   r   r   r   r   r   r   r   r   r   r    r!   N  ó    ûr!   NrM   r   r   r   r    rt   M  rN   rt   c                   @   r   )rj   c                   @   r   )zCProblemSolutionContentAppContentRecommendedSolutionsSerializer.Metarm   N)r   r   r   r   r   r   r   r   r   r    r!   ]  r"   r!   c                 C   r<   ©N)Ú6problemSolutionContentAppContentRecommendedSolutionsIdr0   )r   r   r)   r*   r   r?   r[   r@   r   r   r    rc   g  rC   zHProblemSolutionContentAppContentRecommendedSolutionsSerializer.get_titlec                 C   r<   rw   )r   r   r)   r*   r   r?   rn   r@   r   r   r    rq   q  rC   zNProblemSolutionContentAppContentRecommendedSolutionsSerializer.get_descriptionNrr   r   r   r   r    rj   Y  rs   rj   c                   @   rK   )ÚFProblemSolutionContentAppContentRecommendedSolutionsLanguageSerializerc                   @   ru   )zKProblemSolutionContentAppContentRecommendedSolutionsLanguageSerializer.Metar   r[   rn   rx   N)r   r   r   r   r   r   r   r   r   r   r    r!   }  rv   r!   NrM   r   r   r   r    ry   |  rN   ry   N)"Úrest_frameworkr   Úcommon.commonr   Úmama_care_api.settingsr   Úproblem_solution_content_modelsr   r   r   r	   r
   r   r   r   r   r   r   r   r   ÚModelSerializerr   r+   rL   rG   rV   rI   rZ   r4   rl   rh   rt   rj   ry   r   r   r   r    Ú<module>   s"    < DP##