
    W8i^                         d dl mZ d dlmZ d dlZ ej
                  e      Z G d dej                        Z	 G d dej                        Z
y)    )serializers)TonyCallNc                   p    e Zd Z ej                         Z ej                         Zd Z G d d      Zd Z	y)TonyCallListSerializerc                 6    |j                   xs |j                  S Ncall_date_time
created_atselfobjs     J/var/www/html/dp2/backend_v2.1/server/apps/calls/serializers/tony_calls.pyget_call_date_timez)TonyCallListSerializer.get_call_date_time       !!3S^^3    c                       e Zd ZeZdZeZy)TonyCallListSerializer.Meta)idcall_idr
   called_number	called_to	intentionstatusrecording_urlcompanyrescheduledbooking_datetimeN__name__
__module____qualname__r   modelfieldsread_only_fields r   r   Metar      s    
 "r   r'   c                 <   |ro	 |j                   j                  t        |j                   dt        |j                   dd            t        |j                   dt        |j                   dd            dS y # t        $ r}t        j                  |       Y d }~y d }~ww xY w)Ncompany_namename company_phonephone)r   r*   r-   )r   r   getattr	Exceptionloggerwarning)r   r   excs      r   get_companyz"TonyCallListSerializer.get_company!   s    ++..#CKKV\^`Aab$S[[/73;;X_acCde    s#s   A-A3 3	B<BBN)
r    r!   r"   r   SerializerMethodFieldr   r
   r   r'   r3   r&   r   r   r   r   	   s6    /k//1G6[668N4" ""r   r   c                   ~    e Zd Z e       j                  j
                  Z ej                         Z	d Z
 G d d      Zy)TonyCallDetailSerializerc                 6    |j                   xs |j                  S r   r	   r   s     r   r   z+TonyCallDetailSerializer.get_call_date_time3   r   r   c                       e Zd ZeZdZdZy)TonyCallDetailSerializer.Meta__all__)r   Nr   r&   r   r   r'   r9   6   s    "r   r'   N)r    r!   r"   r   r3   __self__r   r   r4   r
   r   r'   r&   r   r   r6   r6   /   s5    $&22;;G6[668N4# #r   r6   )rest_frameworkr   apps.calls.modelsr   logging	getLoggerr    r0   ModelSerializerr   r6   r&   r   r   <module>rA      sG    & &  
		8	$#[88 #L
#{:: 
#r   