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/helpdesk/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/helpdesk/__pycache__/forms.cpython-310.pyc
o

hͦh<�@sDdZddlmZddlmZddlmZddlmZddl	m
Z
mZddlm
Z
mZddlmZdd	lmZdd
lmZmZmZmZmZmZmZddlmZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#Gdd�dej�Z$Gdd�dej�Z%Gdd�de�Z&d S)!a�
forms.py

This module contains the form classes used in the application.

Each form represents a specific functionality or data input in the
application. They are responsible for validating
and processing user input data.

Classes:
- YourForm: Represents a form for handling specific data input.

Usage:
from django import forms

class YourForm(forms.Form):
    field_name = forms.CharField()

    def clean_field_name(self):
        # Custom validation logic goes here
        pass
�)�Any)�forms��render_to_string)�	ModelForm)�filtersubordinatesemployeemodel�is_reportingmanager)�
Department�JobPosition)�MultipleFileField)�Employee)�FAQ�
Attachment�Comment�DepartmentManager�FAQCategory�Ticket�
TicketType)�horilla_middlewaresc@s"eZdZGdd�d�Zdd�ZdS)�TicketTypeFormc@�eZdZeZdZdgZdS)zTicketTypeForm.Meta�__all__�	is_activeN)�__name__�
__module__�__qualname__r�model�fields�exclude�rr�/var/www/erp/helpdesk/forms.py�Meta0�
r!cO�d|i}td|�}|S�zS
        Render the form fields as HTML table rows with Bootstrap styling.
        �formzhorilla_form.htmlr��self�args�kwargs�context�
table_htmlrrr �as_p5�
zTicketTypeForm.as_pN)rrrr!r,rrrr r.src�*eZdZGdd�d�Z�fdd�Z�ZS)�FAQFormc@s6eZdZeZdZdgZe��ej	ddd�d�d�Z
dS)	zFAQForm.Metarr�/oh-select oh-select-2 select2-hidden-accessiblezupdateTag(this)��class�onchange��attrs)�category�tagsN)rrrr
rrrr�HiddenInput�SelectMultiple�widgetsrrrr r!?s��
�r!cs@t�j|i|��t|jdj�|jd_|jdj�d�dS)��
        Initializes the Ticket tag form instance.
        If an instance is provided, sets the initial value for the form's .
        r7��create_new_tagzCreate new tagN)�super�__init__�listr�choices�append)r'r(r)��	__class__rr r?MszFAQForm.__init__�rrrr!r?�
__classcell__rrrCr r/>�r/csJeZdZejejddid�d�ZGdd�d�Zdd�Z�fd	d
�Z	�Z
S)�
TicketForm�type�dater4)�widgetc@s.eZdZeZgd�Zdejddd�d�iZdS)zTicketForm.Meta)�id�title�employee_id�description�ticket_type�priority�deadliner7�	raised_on�oh-select oh-select-2�true�r2�requiredr4N�	rrrrrrr�Selectr:rrrr r!Zs��r!cOr#r$rr&rrr r,or-zTicketForm.as_pcst�j|i|��tddd�|jd<ttjdd�}|�d�}|r$|j}n|j	j
}t|tj
jdd�d	d
�tj
j|j	d�B|jd_||jd_|j	�d
�rat|jdj�|jd_|jdj�d�|j	�d�r~t|jdj�|jd_|jdj�d�dSdS)N�AttachementsF)�labelrW�
attachment�request�instanceT)rzhelpdesk.add_ticket)�perm)�employee_user_idrNzhelpdesk.add_tickettyperP)�create_new_ticket_typezCreate new ticket type�
base.add_tagsr7r<)r>r?rr�getattrr�_thread_locals�getrN�user�employee_getrr�objects�filter�queryset�initial�has_permr@rArB)r'r(r)r]r^�employeerCrr r?ws8�
���
���zTicketForm.__init__)rrrr�	DateField�	DateInputrRr!r,r?rFrrrCr rHWs
rHcr.)�
TicketTagFormc@s,eZdZeZdgZdejddd�d�iZdS)zTicketTagForm.Metar7r0zupdateTag()r1r4N)	rrrrrrrr9r:rrrr r!�s����r!cs^t�j|i|��ttjdd�}|j�d�r-t|jdj	�|jd_	|jdj	�
d�dSdS)r;r]Nrbr7r<)r>r?rcrrdrfrlr@rrArB)r'r(r)r]rCrr r?�s�zTicketTagForm.__init__rErrrCr rp�rGrpc@�eZdZGdd�d�ZdS)�TicketRaisedOnFormc@s.eZdZeZddgZdejddd�d�iZdS)zTicketRaisedOnForm.Meta�assigning_typerSrTrUrVr4NrXrrrr r!�s��r!N�rrrr!rrrr rr��rrc@rq)�TicketAssigneesFormc@seZdZeZdgZdS)zTicketAssigneesForm.Meta�assigned_toN)rrrrrrrrrr r!�s�r!Nrtrrrr rv�rurvc@rq)�FAQCategoryFormc@r)zFAQCategoryForm.MetarrN)rrrrrrrrrrr r!�r"r!Nrtrrrr rx�rurxc@rq)�CommentFormc@s(eZdZeZdgZdgZde��iZ	dS)zCommentForm.Meta�commentrrNN)
rrrrrrrrr8r:rrrr r!�s�r!Nrtrrrr ry�ruryc@s:eZdZejejddddd�d�dd�ZGd	d
�d
�ZdS)�AttachmentForm�file�Filezform-control�True)�namerIr2�multipler4�)rKr[c@seZdZeZgd�ZdgZdS)zAttachmentForm.Meta)r|rz�ticketrN)rrrrrrrrrrr r!�s
r!N)rrrr�	FileField�	TextInputr|r!rrrr r{�s���r{cr.)�DepartmentManagerCreateFormc@s,eZdZeZddgZdejddid�iZdS)z DepartmentManagerCreateForm.Meta�
department�managerr3zgetDepartmentEmployees($(this))r4N)	rrrrrrrrYr:rrrr r!�s���r!csRt�j|i|��d|vr'|dj}|jjddd�}tjj|d�|jd_	dSdS)Nr^rNT)�flat)�id__inr�)
r>r?r��employeeworkinformation_set�values_listrrhrirrj)r'r(r)r��	employeesrCrr r?�s
��z$DepartmentManagerCreateForm.__init__rErrrCr r��sr�N)'�__doc__�typingr�djangor�django.template.loaderr�
base.formsr�base.methodsrr�base.modelsr	r
�employee.formsr�employee.modelsr�helpdesk.modelsr
rrrrrr�horillarrr/rHrprrrvrxryr{r�rrrr �<module>s*$	?


Youez - 2016 - github.com/yon3zu
LinuXploit