
    
Ug                     Z   d dl mZ ddlT d dlmZmZmZmZmZm	Z	m
Z
mZmZ  G d dej                  Z G d dej                  Z G d	 d
ej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d dej                  Z G d d ej                  Zd!S )"    )serializers   )*)	ContentManagementFaqOnBoardingDataAdminExerciseAdminSubExerciseFitnessLevelDiscoverMainCategoryDiscoverSubCategoryDiscoverExercisec                       e Zd Z ej                    Z ej                    Z ej                    Z ej                    Z G d d          Z	d Z
d Zd Zd ZdS )AppUserSerializerc                       e Zd ZeZg dZdS )AppUserSerializer.Meta)	full_nameemailemail_verifiedphone_numbergenderagecurrent_weightaddresslatitude	longitudetarget_weightweight_unitcurrent_heightheight_unit
focus_area	main_goalcurrent_body_shapefitness_levelmedical_conditionallergies_exclusionsimageis_profile_completedN__name__
__module____qualname__AppUsermodelfields     :/var/www/html/Alfredo_demo/alfredo/user_app/serializers.pyMetar      s'        
%c c c&&&r1   r3   c                     |j         }|r=|                    d                              dd                              d          }ng }|S Nz[]' z, r!   stripreplacesplitselfobjfocus_area_stringr!   s       r2   get_focus_areaz AppUserSerializer.get_focus_area   P    n !''--55c2>>DDTJJ:::	r1   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   )r"   r9   r:   r;   )r=   r>   main_goal_stringr"   s       r2   get_main_goalzAppUserSerializer.get_main_goal   sP    ] %%d++33C<<BB4HH999	r1   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   )r%   r9   r:   r;   )r=   r>   medical_condition_stringr%   s       r2   get_medical_conditionz'AppUserSerializer.get_medical_condition#   sU     2 /55d;;CCCLLRRSWXX	r1   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   )r&   r9   r:   r;   )r=   r>   allergies_exclusions_stringr&   s       r2   get_allergies_exclusionsz*AppUserSerializer.get_allergies_exclusions+   sU     # 8  5;;DAAII#rRRXXY]^^	r1   N)r*   r+   r,   r   SerializerMethodFieldr!   r"   r%   r&   r3   r@   rD   rG   rJ   r0   r1   r2   r   r      s        /k/11.[.006[68899;;c c c c c c c c          r1   r   c                   (    e Zd Z G d d          ZdS )ContentSerializerc                       e Zd ZeZg dZdS )ContentSerializer.Meta)idtext	user_typeN)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   rO   5   s        
%&&&&&&r1   r3   Nr*   r+   r,   r3   r0   r1   r2   rM   rM   4   s<        ' ' ' ' ' ' ' ' ' 'r1   rM   c                   (    e Zd Z G d d          ZdS )FAQSerializerc                       e Zd ZeZdZdS )FAQSerializer.Meta__all__N)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   rW   :   s        
%&&&r1   r3   NrS   r0   r1   r2   rU   rU   9   <                 r1   rU   c                   (    e Zd Z G d d          ZdS )OnBoardingSerializerc                       e Zd ZeZdZdS )OnBoardingSerializer.MetarX   N)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   r]   ?   s        
%&&&r1   r3   NrS   r0   r1   r2   r[   r[   >   rY   r1   r[   c                   (    e Zd Z G d d          ZdS )AdminExerciseSerializerc                       e Zd ZeZdZdS )AdminExerciseSerializer.Meta)rP   namedescriptionr'   dayN)r*   r+   r,   r	   r.   r/   r0   r1   r2   r3   ra   E   s        
%7&&&r1   r3   NrS   r0   r1   r2   r_   r_   D   s<        8 8 8 8 8 8 8 8 8 8r1   r_   c                   P    e Zd Z ej        d          Z G d d          Zd ZdS )ExerciseLevelSerializerget_exercisesourcec                       e Zd ZeZg dZdS )ExerciseLevelSerializer.Meta)rP   rb   r'   exerciseN)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   rk   L   s        %	)	)	)&&&r1   r3   c                 n    t           j                            |          }t          |d          j        S )N)exercise_levelT)many)r	   objectsfilterr_   data)r=   r>   fitness_level_objs      r2   rg   z$ExerciseLevelSerializer.get_exerciseP   s3    !)000DD	 !2	=	=	=	BBr1   N)r*   r+   r,   r   rK   rl   r3   rg   r0   r1   r2   rf   rf   J   se        
++
+>
B
B
B* * * * * * * *C C C C Cr1   rf   c                       e Zd Z ej                    Z ej                    Z ej                    Z G d d          Zd Z	d Z
d ZdS )AdminSubExerciseSerializerc                       e Zd ZeZdZdS )AdminSubExerciseSerializer.Meta)rP   rb   rc   commentsnoter!   setsrepsyoutube_linkvideosimages
video_linkN)r*   r+   r,   r
   r.   r/   r0   r1   r2   r3   rw   Y   s        
% K&&&r1   r3   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   )r~   r9   r:   r;   )r=   r>   images_stringimages_arrays       r2   
get_imagesz%AdminSubExerciseSerializer.get_images^   O    *- %%d++33C<<BB4HH<<<	r1   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   )r}   r9   r:   r;   )r=   r>   videos_stringvideos_arrays       r2   
get_videosz%AdminSubExerciseSerializer.get_videosf   r   r1   c                     |j         }|r=|                    d                              dd                              d          }ng }|S r5   r8   r<   s       r2   r@   z)AdminSubExerciseSerializer.get_focus_arean   rA   r1   N)r*   r+   r,   r   rK   r~   r}   r!   r3   r   r   r@   r0   r1   r2   ru   ru   U   s        
++
+
-
-
++
+
-
-/k/11K K K K K K K K
        r1   ru   c                   f    e Zd Z ed            ej        d          Z G d d          Zd ZdS )AppUserFriendSerializer	hehsdfhsdget_friend_statusrh   c                       e Zd ZeZg dZdS )AppUserFriendSerializer.Meta)rP   r   r'   r   r   friend_statusNr)   r0   r1   r2   r3   r   |   s        
%EEE&&&r1   r3   c                 0   | j                             d          }t          j                            t
                              ||          t
                              ||          z            }|sd }n |D ]}|j        dk    rd}|j        dk    rd}|S )N
login_user)	from_userto_userTfriendsF	requested)contextgetFriendsrp   rq   modelsQaccepted)r=   r>   r   r   r   s        r2   r   z)AppUserFriendSerializer.get_friend_status   s    |--*
 /((	88j#8..CQ[1\1\\ - 
 !== ! !w]]		U	"	" ]	r1   N)	r*   r+   r,   printr   rK   r   r3   r   r0   r1   r2   r   r   y   sy        {22:MNNNF F F F F F F F    r1   r   c                   <    e Zd Z e            Z G d d          ZdS )SentUserFriendListSerializerc                       e Zd ZeZg dZdS )!SentUserFriendListSerializer.Meta)rP   r   r   Nr*   r+   r,   r   r.   r/   r0   r1   r2   r3   r      s        
%(((&&&r1   r3   N)r*   r+   r,   r   r   r3   r0   r1   r2   r   r      sJ        ""$$) ) ) ) ) ) ) ) ) )r1   r   c                   R    e Zd Z ed            e            Z G d d          ZdS ) ReceivedUserFriendListSerializer	243242343c                       e Zd ZeZg dZdS )%ReceivedUserFriendListSerializer.Meta)rP   r   r   Nr   r0   r1   r2   r3   r      s        
%***&&&r1   r3   N)r*   r+   r,   r   r   r   r3   r0   r1   r2   r   r      sZ        {$$&&+ + + + + + + + + +r1   r   c                   (    e Zd Z G d d          ZdS )ExerciseSerializerc                       e Zd ZeZdZdS )ExerciseSerializer.MetarX   N)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   r      s        
%&&&r1   r3   NrS   r0   r1   r2   r   r      rY   r1   r   c                   R     e Zd Z edd          Z G d d          Z fdZ xZS )SubCategorySerializerT)ro   	read_onlyc                       e Zd ZeZdZdS )SubCategorySerializer.MetarX   Nr*   r+   r,   r   r.   r/   r0   r1   r2   r3   r      s        
%&&&r1   r3   c                     t          t          |                               |          }t          |           |d         d k    r|S d S )Nend_date)superr   to_representationr   r=   instancerr   	__class__s      r2   r   z'SubCategorySerializer.to_representation   sI    	$d	+	+	=	=h	G	G$+++	*t
; r1   )r*   r+   r,   r   	exercisesr3   r   __classcell__r   s   @r2   r   r      su        TT:::               r1   r   c                   T     e Zd Z eddd          Z G d d          Z fdZ xZS )MainCategorySerializerTdiscoversubcategory_setro   r   ri   c                       e Zd ZeZg dZdS )MainCategorySerializer.Meta)rP   rb   
start_dater   sub_categoriesN)r*   r+   r,   r   r.   r/   r0   r1   r2   r3   r      s        
%CCC&&&r1   r3   c                     t          t          |                               |          }d |d         D             |d<   |S )Nc                     g | ]}||S )Nr0   ).0subs     r2   
<listcomp>z<MainCategorySerializer.to_representation.<locals>.<listcomp>   s    UUUCS_C___r1   r   )r   r   r   r   s      r2   r   z(MainCategorySerializer.to_representation   sE    	%t	,	,	>	>x	H	H$UU40@+AUUU$	+r1   )r*   r+   r,   r   r   r3   r   r   r   s   @r2   r   r      s        ''TTJcdddD D D D D D D D        r1   r   c                   D    e Zd Z eddd          Z G d d          ZdS )!GetSubCategoryExercisesSerializerTdiscoverexercise_setr   c                       e Zd ZeZg dZdS )&GetSubCategoryExercisesSerializer.Meta)rP   titlerc   r'   r   main_categoryr   Nr   r0   r1   r2   r3   r      s        
%ZZZ&&&r1   r3   N)r*   r+   r,   r   r   r3   r0   r1   r2   r   r      s^        TTAWXXX[ [ [ [ [ [ [ [ [ [r1   r   N)rest_frameworkr   r   admin_panel.modelsr   r   r   r	   r
   r   r   r   r   ModelSerializerr   rM   rU   r[   r_   rf   ru   r   r   r   r   r   r   r   r0   r1   r2   <module>r      s;   & & & & & &     p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p  p+ + + + +3 + + +\' ' ' ' '3 ' ' '
    K/   
    ;6   8 8 8 8 8k9 8 8 8C C C C Ck9 C C C    !<   H    k9   6) ) ) ) );#> ) ) )+ + + + +{'B + + +    4   

 
 
 
 
K7 
 
 
	 	 	 	 	[8 	 	 	[ [ [ [ [(C [ [ [ [ [r1   