U
    x.e6                     @   s   d dl Z d dlmZ d dlmZ G dd dejZG dd dejZG dd	 d	ejZG d
d dejZ	G dd dejZ
G dd dejZG dd dejZG dd dejZG dd dejZG dd dejZG dd dejZdS )    N)User)modelsc                       s  e Zd ZejeejdZejddddZ	ej
dddZejddZejddddZejddddZejddddZejddddZejddddZejddddZejd	dddZejd	dddZejddddZejddddZejddddZejddddZejd	dddZejd	dddZejd	dddZejd	dddZejd	dddZejddddZ ejddddZ!ejddddZ"ejddddZ#ejddddZ$ejd	dddZ%ejd	dddZ&ejd	dddZ'ejd	dddZ(ejd	dddZ)ejddZ*ejd	dddZ+ejd	dddZ,ejd	dddZ-ejddddZ.ejd
ddddZ/ejddddZ0ejddZ1ejddddZ2ejd
ddddZ3ej
dddZ4ejddddZ5ejddddZ6ejddddZ7ejddddZ8ej
dddZ9ejddZ:ej
dddZ;ejddZ<ejddZ=ej
dddZ>ej?ddZ@ej?ddZAejddZBejddddZCejddddZDejddddZEej
dddZFejddddZGej
dddZHej
dddZIejdddddZJejddddZKejddddZLejddZMejNdd
ddZOd fdd	ZP  ZQS )
Personales	on_delete<   T
max_lengthnullblankr
   r   r   default
   d      zSi/No)r	   	help_textr
   r   zABG. ADRIANA RIVAS)r	   r
   r   r      	   )
max_digitsdecimal_placesr   FNc                    s~   | j r2tjt| j d}tj j| j | _| jrltjt| j d}|jtj jkrfd| _	nd| _	t
t|   d S )N%Y-%m-%dAF)f_nacimientodatetimestrptimestrnowyeardateedadfinalizacion_contratoestadosuperr   save)selfforce_insertforce_updateusingupdate_fieldsfecha	__class__ +/var/www/html/TransitoApp/THumano/models.pyr$   V   s    zPersonales.save)FFNN)R__name__
__module____qualname__r   
ForeignKeyr   CASCADEusuario	CharFieldZl_nacimiento	DateFieldr   IntegerFieldr    ZgeneroZetniaZe_civilZnacionalidadZcelulartelefono
EmailFieldZcorreo_pZcorreo_iZlugar	provinciaZcanton	parroquiaZbarrioZcalle_principalZcalle_secundariaZnumero_casaZ
referenciaZnombre_contactoZ
parentescoZcedula_contactoZcelular_contactoZconvencional_contactoZ	direcciontitulopaisareaZinstitucion_educativaZnumero_periodosZtipo_periodoZegresadoZnumero_registrotipo_sangrediscapacidadtipo_discapacidadporcentaje_discapacidadZcarnet_CONADISZ	sustitutoZfecha_declaracionZnombres_familiarZtelefono_sustitutoZt_enfermedad_sustitutoZenfermedad_sustitutoZingreso_institucionZtiempo_servicioZ%ultima_fecha_entrada_servicio_publicoZultimo_tiempo_servicio_aniosZultimo_tiempo_servicio_mesesr!   BooleanFieldr"   ZacumulacionZcuenta_bancariabancoZtipo_cuentaZ	solicitudfecha_entregaZinforme_tecnicoZ
completadoZfirmaservidorZfinanzasZarchivoZnumero_mesesDecimalFieldZremuneracionr$   __classcell__r-   r-   r+   r.   r      s          r   c                       sN   e Zd ZejeejdZejddZ	e
 ZejddZd
 fdd		Z  ZS )	Licenciasr      r	   Tr   FNc                    sb   t j t| jd}t  t j  jt j  jt j  j}||krJd| _nd| _t	t
|   d S )Nr   TF)r   r   r   f_caducidadr   r   monthdayr"   r#   rI   r$   )r%   r&   r'   r(   r)   r*   Zfecha2r+   r-   r.   r$   m   s    &zLicencias.save)FFNN)r/   r0   r1   r   r2   r   r3   r4   r5   tipor6   rL   rC   r"   r$   rH   r-   r-   r+   r.   rI   g   s          rI   c                   @   s4   e Zd ZejeejdZejddZ	ej
ddZdS )Enfermedadesr   Fr   r   rK   N)r/   r0   r1   r   r2   r   r3   r4   rC   Zcatastroficar5   
enfermedadr-   r-   r-   r.   rP   x   s   rP   c                   @   s   e Zd Zejeejdd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jddZejdddZejdddZejdd	d
ZdS )CapacitacionTr   r
   r   x   rK   r   r   r   r   ZEcuadorr	   r   N)r/   r0   r1   r   r2   r   r3   r4   r5   ZeventorO   r7   ZduracionZauspicianteZtipo_certificadoZcertificado_porr6   Zfecha_inicioZfecha_finalizacionr=   r-   r-   r-   r.   rR   }   s   rR   c                   @   s   e Zd ZejeejdZejddZ	ej
dddZejddZejdddZejddZej
dddZejdddZejdddZd	S )
TrayectoriaLaboralr   r   rK   Tr   r    rU   N)r/   r0   r1   r   r2   r   r3   r4   r5   Ztipo_insititucionr6   fecha_ingresoZnombre_insitutucionZunidad_administrativaZpuestoZfecha_salidaZmotivo_ingresoZmotivo_salidar-   r-   r-   r.   rV      s   rV   c                   @   sV  e Zd ZejeejdZejddddZ	ejddddZ
ejddddZejddddZejdddZejddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZejddddZd	S )
Viviendar   r   Tr   r   r   r   r   N)r/   r0   r1   r   r2   r   r3   r4   r5   Ztipo_relacionZtipo_documentoZnumero_documentonombresr6   Zfecha_nacimientor7   r    Zestado_civilZinstruccion_formalZ	profesionZinstitucion_laboraZtipo_institucionZingreso_mensualr@   rA   rB   Zcarnet_conadisrQ   Ztipo_enfermedadr?   Zvive_con_ustedr-   r-   r-   r.   rY      s*   rY   c                   @   sD  e Zd Zejeej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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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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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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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jddZ-ejddZ.ejddZ/ejddZ0ejddZ1ejddZ2ejddZ3ejddZ4ejddZ5ejddZ6ejddZ7dS )CondicionesVidar   Tr   r   rK   N)8r/   r0   r1   r   r2   r   r3   r4   rC   ZaguaZalumbrado_viviendaZalumbrado_publicoZalcantarilladoZcallesZbasuraZiglesiaZhospitalZcentro_medicoZ	subcentroZescuelaZcolegioZmercadoZtelefono_convencionalZtelefono_celularZinternetZ
transporteZ	seguridadZestado_callesZacerasZ	bordillosZcolector_aguas_lluviasr5   otrosZtenencia_viviendaZtipo_viviendaZtipo_familiaZdormitoriosZsalaZcomedorZsala_comedorZcocinaZbaniosZpatioZgarajeZotros_cZpotableZhervidaZtratadaZcisternaZpozoZ	tanquerosZotro_aalimentacionZrecolector_basuraZquma_basuraZotro_br-   r-   r-   r.   r[      s^   r[   c                   @   s   e Zd ZejeejdddZejddddZ	ejddddZ
ejddddZejddddZejddddZejddddZejddddZejddddZejddddZdS )InformacionMonetariaTrS   r   r   r   )r   r   r   N)r/   r0   r1   r   r2   r   r3   r4   rG   ZviviendaZmanutencionZ	educacionZmedicinar]   Z	vestuarioZextraordinariototalZahorror-   r-   r-   r.   r^      s   r^   c                   @   s   e Zd Zejeej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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j
ddZdS )EnfermedadesAccidentesr   Fr   r   rK   N)r/   r0   r1   r   r2   r   Modelr4   rC   Zenfermedadesr5   Zenfermedades_hereditariasZ	accidenteZtipo_accidenteZconsecuenciaZhospital_publicoZhospital_IESSZclinicaZcentro_saludZmedico_particularotror-   r-   r-   r.   r`      s   r`   c                   @   sP   e Zd ZejeejdddZejddZ	ejddZ
ejddZejddZdS )ApoyoEconomicoTrS   Fr   N)r/   r0   r1   r   r2   r   r3   r4   rC   ZpadresZhijoconyugerb   r-   r-   r-   r.   rc      s
   rc   c                   @   s   e Zd Zejeejdd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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jddZejddZejddZejddZejddZdS )InformacionSocialTrS   Fr   N)r/   r0   r1   r   r2   r   r3   r4   rC   rF   rd   Z
familiaresZ
guarderiasZempleada_domesticaZninieraZvecinosr\   ZleerZescuchar_musicaZdeportesZ	reunionesZ
quehaceresZtrabajos_extrasrb   r-   r-   r-   r.   re      s    re   )r   django.contrib.auth.modelsr   	django.dbr   ra   r   rI   rP   rR   rV   rY   r[   r^   r`   rc   re   r-   r-   r-   r.   <module>   s   _1