o
    ­Tïjú!  ã                   @   sp  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
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. G dd„ dej/ƒZ0G dd„ de0ƒZ1G dd„ dej/ƒZ2G dd „ d ej/ƒZ3G d!d"„ d"ej/ƒZ4d#S )$é    )Úserializers)ÚgetLanguage)ÚlanguageKeyé   )ÚContentInformationÚContentInformationLanguageÚTargetAudienceÚContentObjectiveé   )ÚEducationContent)ÚEducationContentSerializer)ÚProblemSolutionContent)Ú ProblemSolutionContentSerializer)ÚRelatableContent)ÚRelatableContentSerializer)ÚInteractiveContent)ÚInteractiveContentSerializer)ÚStoryContent)ÚStoryContentSerializer)ÚTipQuote)ÚTipQuoteSerializer)Ú	Checklist)ÚChecklistSerializer)Ú
AppActions)ÚAppActionsSerializer)ÚContentSafety)ÚContentSafetySerializerc                   @   sJ   e Zd Ze ¡ Ze ¡ Ze ¡ ZG dd„ dƒZdd„ Z	dd„ Z
dd„ Zd	S )
Ú!ContentInformationSerializerBasicc                   @   ó   e Zd ZeZg d¢ZdS )z&ContentInformationSerializerBasic.Meta)ÚidÚkeyNameÚcreatedDateÚupdatedDateÚtopicÚcategoryÚsubcategoryN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚfields© r+   r+   úˆ/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/article/content_information/content_information_serializers.pyÚMeta$   ó    r-   c                 C   ó<   t | ƒ}|d urtjj|j|d� ¡ }|d ur|jS d S d S ©N)ÚcontentInformationIdÚ
languageId)r   r   ÚobjectsÚfilterr   Úfirstr#   ©ÚselfÚinstancer2   Útranslationr+   r+   r,   Ú	get_topic0   ó   þýúz+ContentInformationSerializerBasic.get_topicc                 C   r/   r0   )r   r   r3   r4   r   r5   r$   r6   r+   r+   r,   Úget_category:   r;   z.ContentInformationSerializerBasic.get_categoryc                 C   r/   r0   )r   r   r3   r4   r   r5   r%   r6   r+   r+   r,   Úget_subcategoryD   r;   z1ContentInformationSerializerBasic.get_subcategoryN)r&   r'   r(   r   ÚSerializerMethodFieldr#   r$   r%   r-   r:   r<   r=   r+   r+   r+   r,   r      s    

r   c                   @   sÎ   e Zd Ze ¡ Ze ¡ Ze ¡ Ze ¡ Ze ¡ Z	e ¡ Z
e ¡ Ze ¡ Ze ¡ Ze ¡ Ze ¡ ZG dd„ dejƒZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )Ú"ContentInformationSerializerDetailc                   @   s   e Zd Zejjg d¢ ZdS )z'ContentInformationSerializerDetail.Meta)ÚtargetAudienceListÚcontentObjectiveListÚeducationContentListÚproblemSolutionContentListÚrelatableContentListÚinteractiveContentListÚstoryContentListÚtipQuoteListÚchecklistListÚappActionsListÚcontentSafetyListN)r&   r'   r(   r   r-   r*   r+   r+   r+   r,   r-   \   s    r-   c                 C   ó,   t | ƒ}tjj|jd�}t|t|idd�jS ©N)r1   T)ÚcontextÚmany)r   r   r3   r4   r   ÚTargetAudienceSerializerr   Údata©r7   r8   r2   ÚdataListr+   r+   r,   Úget_targetAudienceListk   ó   ÿ
ÿþz9ContentInformationSerializerDetail.get_targetAudienceListc                 C   rK   rL   )r   r	   r3   r4   r   ÚContentObjectiveSerializerr   rP   rQ   r+   r+   r,   Úget_contentObjectiveListt   rT   z;ContentInformationSerializerDetail.get_contentObjectiveListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_educationContentList}   rT   z;ContentInformationSerializerDetail.get_educationContentListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_problemSolutionContentList†   rT   zAContentInformationSerializerDetail.get_problemSolutionContentListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_relatableContentList�   rT   z;ContentInformationSerializerDetail.get_relatableContentListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_interactiveContentList˜   rT   z=ContentInformationSerializerDetail.get_interactiveContentListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_storyContentList¡   rT   z7ContentInformationSerializerDetail.get_storyContentListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_tipQuoteListª   rT   z3ContentInformationSerializerDetail.get_tipQuoteListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_checklistList³   rT   z4ContentInformationSerializerDetail.get_checklistListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_appActionsList¼   rT   z5ContentInformationSerializerDetail.get_appActionsListc                 C   rK   rL   )r   r   r3   r4   r   r   r   rP   rQ   r+   r+   r,   Úget_contentSafetyListÅ   rT   z8ContentInformationSerializerDetail.get_contentSafetyListN)r&   r'   r(   r   r>   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   r   r-   rS   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r+   r+   r+   r,   r?   O   s0    										r?   c                   @   ó   e Zd ZG dd„ dƒZdS )Ú$ContentInformationLanguageSerializerc                   @   s    e Zd ZeZdddddegZdS )z)ContentInformationLanguageSerializer.Metar   r#   r$   r%   r1   N)r&   r'   r(   r   r)   r   r*   r+   r+   r+   r,   r-   Ð   s    úr-   N©r&   r'   r(   r-   r+   r+   r+   r,   ra   Ï   ó    ra   c                   @   r`   )rO   c                   @   r   )zTargetAudienceSerializer.Meta©r   Útitler1   N)r&   r'   r(   r   r)   r*   r+   r+   r+   r,   r-   Ý   r.   r-   Nrb   r+   r+   r+   r,   rO   Ü   rc   rO   c                   @   r`   )rU   c                   @   r   )zContentObjectiveSerializer.Metard   N)r&   r'   r(   r	   r)   r*   r+   r+   r+   r,   r-   ç   r.   r-   Nrb   r+   r+   r+   r,   rU   æ   rc   rU   N)5Úrest_frameworkr   Úcommon.commonr   Úmama_care_api.settingsr   Úcontent_information_modelsr   r   r   r	   Ú*education_content.education_content_modelsr   Ú/education_content.education_content_serializersr   Ú8problem_solution_content.problem_solution_content_modelsr   Ú=problem_solution_content.problem_solution_content_serializersr   Ú*relatable_content.relatable_content_modelsr   Ú/relatable_content.relatable_content_serializersr   Ú.interactive_content.interactive_content_modelsr   Ú3interactive_content.interactive_content_serializersr   Ú"story_content.story_content_modelsr   Ú'story_content.story_content_serializersr   Útip_quote.tip_quote_modelsr   Útip_quote.tip_quote_serializersr   Úchecklist.checklist_modelsr   Úchecklist.checklist_serializersr   Úapp_actions.app_actions_modelsr   Ú#app_actions.app_actions_serializersr   Ú$content_safety.content_safety_modelsr   Ú)content_safety.content_safety_serializersr   ÚModelSerializerr   r?   ra   rO   rU   r+   r+   r+   r,   Ú<module>   s8    0 
