
    hK                        d dl m Z  d dlmZmZ d dl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dS )    )datetime)generate_password_hashcheck_password_hash)dbc                       e Zd ZdZ ej        ej        d          Z ej         ej        d          dd          Z	d Z
dS )	CitycitiesTprimary_keyd   Funiquenullablec                     d| j          dS )Nz<City >nameselfs    1/var/www/api.easyaligner.net/htdocs/app/models.py__repr__zCity.__repr__
   s    $	$$$$    N)__name__
__module____qualname____tablename__r   ColumnIntegeridStringr   r    r   r   r   r      sb        M	2:4	0	0	0B29YRYs^^D5AAAD% % % % %r   r   c                   L   e Zd ZdZ ej        ej        d          Z ej         ej        d          d          Z	 ej         ej        d          d          Z
 ej         ej        d          dd          Z ej         ej        d	                    Z ej        ej         ej        d
                    Z ej        ej                  Z ej         ej        d          d          Z ej         ej        ddd          d          Z ej         ej        d                    Z ej        ej        d          Z ej         ej        d                    Z ej         ej        d                    Z ej        ej                  Z ej        ej        ej                  Z ej        ej        ej        ej                  Z ej        ej        d          Z ej        ej                  Z  ej!        dd          Z"d Z#d Z$d Z%dS )UserusersTr
   r   Fr   x   r      z	cities.id   doctorpatientuser_type_enumr   default   r-   onupdate   r   backrefc                 .    t          |          | _        d S N)r   password_hashr   passwords     r   set_passwordzUser.set_password$   s    3H==r   c                 ,    t          | j        |          S r5   )r   r6   r7   s     r   check_passwordzUser.check_password'   s    "4#5x@@@r   c                 6    t          j                    | _        d S r5   )r   utcnow
deleted_atr   s    r   soft_deletezUser.soft_delete*   s    "/++r   N)&r   r   r   r   r   r   r   r   r    
first_name	last_nameemailphone
ForeignKeycity_idDatebirthdayr6   Enum	user_type
user_tokenBooleanis_verifiedverification_code
reset_codeDateTimereset_code_expirationr   r=   
created_at
updated_atstatusr>   relationshipcityr9   r;   r?   r!   r   r   r#   r#      sT       M	2:4	0	0	0B929S>>E:::J	)")C..5999IBIibinnTEBBBEBIibimm$$Ebi
MBM+$>$>??Gry!!HBIibinnu===M	'"'(I<LMMMX]^^^I929S>>**J")BJ666K!	)")A,,//929Q<<((J%BIbk222;@@@J2;(/ZZZJRYrz1---F2;''J2?67333D> > >A A A, , , , ,r   r#   c                      e Zd ZdZ ej        ej        d          Z ej         ej        d          d          Z	 ej        ej
        d          Z ej         ej        d                    Z ej        ej         ej        d                    Z ej        ej        ej        	          Z ej        d
d          ZdS )PlakplaksTr
   r   Fr%   r(   users.idr,   r#   r2   N)r   r   r   r   r   r   r   r   r    titleTextdescription	image_urlrD   
created_byrO   r   r=   rQ   rT   r)   r!   r   r   rW   rW   -   s        M	2:4	0	0	0BBIibinnu555E")BGe444K	)")C..))I2:}r}Z'@'@AAJ2;@@@JR_VW555FFFr   rW   c                   X   e Zd ZdZ ej        ej        d          Z ej        ej         ej        d          d          Z	 ej        ej         ej        d          d          Z
 ej        ej        ej                  Z ej        d	d
          Z ej        dd          ZdS )SelectedPlakselected_plaksTr
   plaks.idFr%   rY   r,   rW   
selectionsr2   r#   N)r   r   r   r   r   r   r   r   rD   plak_id
patient_idrO   r   r=   selected_atrT   plakr*   r!   r   r   r`   r`   9   s        $M	2:4	0	0	0Bbi
MBM*$=$=NNNG2:}r}Z'@'@5QQQJ")BKAAAK2?6<888Dbof.>???GGGr   r`   c                      e Zd ZdZ ej        ej        d          Z ej        ej         ej        d          d          Z	 ej        ej         ej        d          d          Z
 ej        ej         ej        d          d          Z ej         ej        d          d          Z ej        ej                  Z ej         ej        d          d          Z ej        ej        d          Z ej        ej        ej        	          Z ej        ej        ej        ej        
          Z ej        ej        d          Z ej        de	g          Z ej        de
g          Z ej        dd          ZdS )TreatmentPhototreatment_photosTr
   rY   Fr%   rb   r(   r,   r/   r#   )foreign_keysrW   r2   N)r   r   r   r   r   r   r   r   rD   	doctor_idre   rd   r    rZ   r[   note
photo_pathrF   
photo_daterO   r   r=   rQ   rR   r>   rT   r)   r*   rg   r!   r   r   ri   ri   C   s       &M	2:4	0	0	0B	"*mbmJ&?&?%PPPI2:}r}Z'@'@5QQQJbi
MBM*$=$=NNNGBIibinnu555E29RWD929S>>E:::J27U333J2;@@@J2;(/ZZZJ2;666JR_V9+>>>FbofJ<@@@G2?6+=>>>DDDr   ri   c                   |   e Zd ZdZ ej        ej        d          Z ej        ej         ej        d          d          Z	 ej         ej
        d                    Z ej        ej                  Z ej        ej        d          Z ej        ej        ej                  Z ej        d	d
          ZdS )NotificationnotificationsTr
   rY   Fr%   r(   r,   r#   r2   N)r   r   r   r   r   r   r   r   rD   user_idr    rZ   r[   messagerK   is_readrO   r   r=   rQ   rT   userr!   r   r   rq   rq   W   s        #M	2:4	0	0	0Bbi
MBM*$=$=NNNGBIibinn%%Ebi  Gbi
E222G2;@@@J2?6?;;;DDDr   rq   N)r   werkzeug.securityr   r   app.dbr   Modelr   r#   rW   r`   ri   rq   r!   r   r   <module>rz      s\         I I I I I I I I      % % % % %28 % % %, , , , ,28 , , ,@	6 	6 	6 	6 	628 	6 	6 	6@ @ @ @ @28 @ @ @? ? ? ? ?RX ? ? ?(	< 	< 	< 	< 	<28 	< 	< 	< 	< 	<r   