a
    Se                     @   s   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 e	 Z
dZG dd dZG d	d
 d
ejZG dd dejZG dd dejZdS )    )RichTextField)RichTextUploadingField)models)CKEditor5Field)GoogleCloudStoragezhttps://benotx.beauty/c                   @   s   e Zd Zedd ZdS )Uploadc              
   C   s   z*d| }t || }t| }t| |W S  tyz } z8d| }t| }t| t| td |W  Y d }~S d }~0 0 d S )Nz/images/zFailed to upload!)storagesaveCUSTOM_DOMAIN_PREFIXprint	Exception)filefilenameZtarget_pathpathZfile_urle r   '/var/www/html/benotx_one/home/models.pyupload_image   s    zUpload.upload_imageN)__name__
__module____qualname__staticmethodr   r   r   r   r   r      s   r   c                   @   sT   e Zd ZejddZejddZejddZejddZ	ejddZ
edddZdS )	PostTprimary_key  
max_lengthTextextends)Zconfig_nameN)r   r   r   r   	AutoFieldid	CharFieldtitlefeature_videofeature_photoshort_descriptionr   descriptionr   r   r   r   r   "   s   r   c                   @   sP   e Zd ZejddZejddZejddZejddZ	ejddZ
e ZdS )ProjectTr   r   r   N)r   r   r   r   r    r!   r"   r#   r$   r%   r&   	TextFieldr'   r   r   r   r   r(   +   s   r(   c                   @   s$   e Zd Ze Ze Ze ZdS )ContentStaticPagesN)r   r   r   r   r)   ZprofileZaboutZprivacy_policyr   r   r   r   r*   4   s   r*   N)Zckeditor.fieldsr   Zckeditor_uploader.fieldsr   	django.dbr   Zdjango_ckeditor_5.fieldsr   Zstorages.backends.gcloudr   r   r
   r   Modelr   r(   r*   r   r   r   r   <module>   s   		