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 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é   )Ú
AppActionsÚAppActionsRelatedAppFeaturesÚAppActionsActionButtonsÚAppActionsActionButtonsLanguageÚAppActionsRelatedContentÚ AppActionsRelatedContentLanguagec                   @   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 )
ÚAppActionsSerializerc                   @   ó   e Zd ZeZg d¢ZdS )zAppActionsSerializer.Meta)ÚidÚcontentInformationIdÚrelatedAppFeatureListÚactionButtonListÚrelatedContentListN)Ú__name__Ú
__module__Ú__qualname__r   ÚmodelÚfields© r   r   úx/var/www/snowflake_co_dev_github/snow_flake_back_end_deploy/mama_care_api/article/app_actions/app_actions_serializers.pyÚMeta   ó    r   c                 C   ó,   t | ƒ}tjj|jd�}t|t|idd�jS ©N)ÚappActionsIdT)ÚcontextÚmany)r   r   ÚobjectsÚfilterr   Ú&AppActionsRelatedAppFeaturesSerializerr   Údata©ÚselfÚinstanceÚ
languageIdÚdataListr   r   r   Úget_relatedAppFeatureList   ó   ÿ
ÿþz.AppActionsSerializer.get_relatedAppFeatureListc                 C   r   r   )r   r   r!   r"   r   Ú!AppActionsActionButtonsSerializerr   r$   r%   r   r   r   Úget_actionButtonList'   r+   z)AppActionsSerializer.get_actionButtonListc                 C   r   r   )r   r
   r!   r"   r   Ú"AppActionsRelatedContentSerializerr   r$   r%   r   r   r   Úget_relatedContentList0   r+   z+AppActionsSerializer.get_relatedContentListN)r   r   r   r   ÚSerializerMethodFieldr   r   r   r   r*   r-   r/   r   r   r   r   r      s    
		r   c                   @   ó   e Zd ZG dd„ dƒZdS )r#   c                   @   r   )z+AppActionsRelatedAppFeaturesSerializer.Meta)r   ÚkeyNamer   N)r   r   r   r   r   r   r   r   r   r   r   ;   r   r   N©r   r   r   r   r   r   r   r   r#   :   ó    r#   c                   @   ó*   e Zd Ze ¡ ZG dd„ dƒZdd„ ZdS )r,   c                   @   r   )z&AppActionsActionButtonsSerializer.Meta)r   r2   ÚactionÚdestinationr   ÚlabelN)r   r   r   r   r   r   r   r   r   r   r   G   r   r   c                 C   ó<   t | ƒ}|d urtjj|j|d� ¡ }|d ur|jS d S d S )N)ÚappActionsActionButtonsIdr(   )r   r	   r!   r"   r   Úfirstr8   ©r&   r'   r(   Útranslationr   r   r   Ú	get_labelR   ó   þýúz+AppActionsActionButtonsSerializer.get_labelN)r   r   r   r   r0   r8   r   r>   r   r   r   r   r,   D   ó    r,   c                   @   r1   )Ú)AppActionsActionButtonsLanguageSerializerc                   @   ó   e Zd ZeZdddegZdS )z.AppActionsActionButtonsLanguageSerializer.Metar   r8   r:   N)r   r   r   r	   r   r   r   r   r   r   r   r   ^   ó    ür   Nr3   r   r   r   r   rA   ]   r4   rA   c                   @   r5   )r.   c                   @   r   )z'AppActionsRelatedContentSerializer.Meta)r   ÚreferenceKeyÚcategoryÚrelatedContentIdr   ÚtitleN)r   r   r   r
   r   r   r   r   r   r   r   k   r   r   c                 C   r9   )N)ÚappActionsRelatedContentIdr(   )r   r   r!   r"   r   r;   rG   r<   r   r   r   Ú	get_titlev   r?   z,AppActionsRelatedContentSerializer.get_titleN)r   r   r   r   r0   rG   r   rI   r   r   r   r   r.   h   r@   r.   c                   @   r1   )Ú*AppActionsRelatedContentLanguageSerializerc                   @   rB   )z/AppActionsRelatedContentLanguageSerializer.Metar   rG   rH   N)r   r   r   r   r   r   r   r   r   r   r   r   ‚   rC   r   Nr3   r   r   r   r   rJ   �   r4   rJ   N)Úrest_frameworkr   Úcommon.commonr   Úmama_care_api.settingsr   Úapp_actions_modelsr   r   r   r	   r
   r   ÚModelSerializerr   r#   r,   rA   r.   rJ   r   r   r   r   Ú<module>   s     
+
