
    vi}                        d dl mZ ddlmZmZmZmZmZmZm	Z	 d dl
Z
d dlmZ d dlZd dlZd dlmZ  ej"                  e      ZdZdZd	Z ej.                  eee
      Z G d dej2                        Z G d dej2                        Z G d dej2                        Z G d dej2                        Z G d dej2                        Z G d dej2                        Z G d dej2                        Z y)    )serializers   )ProductSampleEndUserUserActivityShootsInReviewProductDataAddCollectionProductCollectionsProductN)urlparse)
SharedLinks4sb9uwrs421idvqwlwv2hqhupsbbaz@B-Crg4k7lAIAAAAAAAAAAfEvWo-ra7xjYP6ZGJDErSpM4-6Qy1b81ryYBQVBKxuG)oauth2_refresh_tokenapp_key
app_secretc                        e Zd Z G d d      Zy)EndUserSerializerc                       e Zd ZeZdZy)EndUserSerializer.Meta__all__N__name__
__module____qualname__r   modelfields     8/var/www/html/lionshead-backend/panel_api/serializers.pyMetar      s    r   r!   Nr   r   r   r!   r   r   r    r   r           r   r   c                        e Zd Z G d d      Zy)UserActivitySerializerc                       e Zd ZeZdZy)UserActivitySerializer.Metar   N)r   r   r   r   r   r   r   r   r    r!   r'      s    r   r!   Nr"   r   r   r    r%   r%      r#   r   r%   c                   H    e Zd Z ej                  dd      Z G d d      Zy)InReviewProductDataSerializerzclient.emailT)source	read_onlyc                       e Zd ZeZg dZy)"InReviewProductDataSerializer.Meta)idclient_emailassign_date	is_viewed
start_dateend_dateN)r   r   r   r	   r   r   r   r   r    r!   r-   '   s    #[r   r!   N)r   r   r   r   
EmailFieldr/   r!   r   r   r    r)   r)   $   s"    );))4PL\ \r   r)   c                        e Zd Z G d d      Zy)UserSerializerc                       e Zd ZeZg dZy)UserSerializer.Meta)r.   
first_name	last_nameemailNr   r   r   r    r!   r8   ,   s    ;r   r!   Nr"   r   r   r    r6   r6   +   s    < <r   r6   c                   .    e Zd Z e       Z G d d      Zy)ShootsSerializerc                       e Zd ZeZg dZy)ShootsSerializer.Meta)userr2   r3   
is_watcherN)r   r   r   r   r   r   r   r   r    r!   r?   3   s    @r   r!   N)r   r   r   r6   r@   r!   r   r   r    r=   r=   0   s    DA Ar   r=   c                   p    e Zd Z ej                         Z ej                         Z G d d      Zd Zd Z	y)ProductSampleSerializerc                       e Zd ZeZdZy)ProductSampleSerializer.Metar   Nr   r   r   r   r   r   r   r   r    r!   rE   ;       r   r!   c                 p    t         j                  j                  |      }t        |d      j                  S )NproductT)many)r	   objectsfilterr)   data)selfobjreview_datas      r    get_assigned_clientsz,ProductSampleSerializer.get_assigned_clients?   s.    )11888E,[tDIIIr   c                     t         j                  j                  |      j                  d      }|D cg c]%  }|j                  s|j                  j
                  ' }}|S c c}w )z5Get all collection names that this product belongs torI   
collection)r
   rL   rM   select_relatedrT   collection_name)rO   rP   collection_productscpcollection_namess        r    get_collection_namesz,ProductSampleSerializer.get_collection_namesC   s^    2::AA#AN]]^jkDWiDWb[][h[hBMM99DWi js   A"A"N)
r   r   r   r   SerializerMethodFieldassigned_clientsrY   r!   rR   rZ   r   r   r    rC   rC   7   s9    8{88:8{88: J r   rC   c                        e Zd Z G d d      Zy)ProductSampleSerializerClientc                       e Zd ZeZdZy)"ProductSampleSerializerClient.Metar   NrF   r   r   r    r!   r`   K   rG   r   r!   Nr"   r   r   r    r^   r^   I   s     r   r^   )!rest_frameworkr   modelsr   r   r   r   r	   r
   r   requestsurllib.parser   dropboxloggingdropbox.filesr   	getLoggerr   loggerAPP_KEY
APP_SECRETREFRESH_TOKENDropboxdbxModelSerializerr   r%   r)   r6   r=   rC   r^   r   r   r    <module>rp      s    & y y y  !   $ 
		8	$ 
Rgoo&33 [88 \K$?$? \<[00 <
A{22 A k99  $K$?$? r   