a
     ld	                     @   sT   d dl m Z  d dlmZ d dlmZ dd ZG dd dejZG dd	 d	ejZd
S )    )datetime)models)HistoricalRecordsc                 C   s8   t t d}|d}d| j||t|d  S )Nz%Y_%m_%d_%H_%M_%S.zplatform/{0}_{1}.{2}   )strr   nowstrftimesplitformatidlen)instancefilenametimestrnew_filename r   =/var/www/html/Ranjet/backend/verify_trusted/reviews/models.pyuser_directory_path   s
    
r   c                   @   s   e Zd ZG dd dejZejdddZeje	ddddZ
ejdd	Zejddd
ZejdddZejdejejddZejddddZG dd dZdS )Platformc                   @   s   e Zd ZdZdZdZdZdS )zPlatform.StatusACTIVEINACTIVEUNAVAILABLEHIDE_REVIEWSN)__name__
__module____qualname__r   r   r   r   r   r   r   r   Status   s   r   d   T)
max_lengthblank  )	upload_tonullr    r   F)default)uniquer   )r    r   2   )r   choicesr$   db_indexNr    r#   r$   c                   @   s   e Zd ZddgZdS )zPlatform.Metadisplay_ordernameN)r   r   r   orderingr   r   r   r   Meta)   s   r-   )r   r   r   r   TextChoicesr   	CharFieldr+   
ImageFieldr   logoBooleanFieldZ
is_popularurlZexample_urlr'   r   statusIntegerFieldr*   r-   r   r   r   r   r      s(   r   c                   @   s   e Zd ZG dd dejZejedejdZ	ejddejdZ
ejddZejddd	d
Zejddd	d
Ze ZejejdejdddZejdddZG dd dZd	S )ReviewSourcec                   @   s   e Zd ZdZdZdZdZdS )zReviewSource.SyncStatusNOT_SYNCSYNCINGSYNCEDFALSEN)r   r   r   r7   r8   r9   r:   r   r   r   r   
SyncStatus.   s   r;   review_sources)related_name	on_deletezcompanies.Companyr!   )r   TNr)      )r'   r   r$   r#   r    )r    r#   c                   @   s    e Zd ZejddgddgZdS )zReviewSource.MetacompanyplatformZunique_company_platform)fieldsr+   N)r   r   r   r   UniqueConstraintconstraintsr   r   r   r   r-   J   s   r-   )r   r   r   r   r.   r;   
ForeignKeyr   CASCADErA   r@   r/   r3   r5   reviews_count
FloatFieldaverage_ratingr   historyr'   r7   Zsync_status	JSONFieldotherr-   r   r   r   r   r6   -   s0   r6   N)	r   	django.dbr   simple_history.modelsr   r   Modelr   r6   r   r   r   r   <module>   s
   