Sindbad~EG File Manager

Current Path : /home/numerotech/hs.numerotech.com/scan_v1/core/model/__pycache__/
Upload File :
Current File : //home/numerotech/hs.numerotech.com/scan_v1/core/model/__pycache__/BadgeUserModel.cpython-310.pyc

o

m��e���@s�ddlmZmZmZmZmZmZmZmZddl	m
Z
mZddlm
Z
ddlZee
jddddd�Zee
jd	dddd�ZGd
d�d�ZdS)�)�
create_engine�MetaData�Table�insert�select�update�delete�text)�and_�or_)�appN�DATABASE_URITi)�
pool_pre_ping�pool_recycle�future�DATABASE_URI_FKc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d:�Zd^S)_�BadgeUserModelc
Cs>zt�|_WdSty}zt|�WYd}~dSd}~ww)N)r�meta�	Exception�print)�self�e�r�Z/home/numerote/conference.numerotech.com/food_kit_scan_badges/core/model/BadgeUserModel.py�__init__s��zBadgeUserModel.__init__cCs�d}d}t��}|��}|�d||||g�|jrBdd�|jD�}g}	|��D]}
|	�tt||
���q'|�	�|�
�|	r@dSdS|�	�|�
�dS)N�numerote_primary_dbZnumerote_foodkitZcreate_table_for_confcS�g|]}|d�qS�rr��.0�columnrrr�
<listcomp>M�z3BadgeUserModel.createConfTables.<locals>.<listcomp>�success��	engine_fk�raw_connection�cursor�callproc�description�fetchall�append�dict�zip�close�commit)r�conf_id�conf_key�curr_dt�main_dbZ
foodkit_db�
connectionr'�columns�results�rowrrr�createConfTablesFs$zBadgeUserModel.createConfTablescCsdt���$}td|d�}|�|���}|r|Wd�S	Wd�dS1s+wYdS)Nzrselect delegate_no,full_name,email,mobile,role,city,state,membership_no,mc_number,company_name,counter,batch from �	 limit 1;)�engine�connectr	�execute�keys�rr0�del_table_name�conn�stmtr6rrr�getDelegatesTableColumnas
�$�z&BadgeUserModel.getDelegatesTableColumnc
Cs�g}z`t��}|��}|�d|||||g�	dd�|jD�}	g}
	|��}|dur+n
tt|	|��}|
�|�q"|�t	|
��|�
�durFn|jdurLnqW|��|��|SW|��|��|S|��|��w)NZ!usp_delegates_bulk_upload_preview�cSrrr�r�crrrr!tr"zCBadgeUserModel.insertBulkUploadTempTablePreview.<locals>.<listcomp>)
r:r&r'r(r)�fetchoner,r-r+�list�nextsetr/r.)
rr0�insert_query�columnssr?�del_nos�setsr4r'�names�set_�row_rawr7rrr� insertBulkUploadTempTablePreviewls>
�
���
z/BadgeUserModel.insertBulkUploadTempTablePreviewc
Cs�t���E}z&td|d|d|d|d�}|�|�}|��WWd�dStyH}	zt|	�WYd}	~	Wd�Sd}	~	ww1sLwYdS)N�INSERT INTO � (�)SELECT �" from bulk_upload  where conf_id =�  ;r#)r:r;r	r<r/r�str)
rr0rIrJr?�checked_del_nosr@rAr6rrrr�insertBulkUpload�s
(
����zBadgeUserModel.insertBulkUploadcCs�t���c}zDtd�}|�|�|��t|�}|�|�|��td|dt|�d�}|�|���}	|	r>dd�|	D�nd}
|
WWd�Styf}zt|�WYd}~Wd�Sd}~ww1sjwYdS)Nztruncate table bulk_upload�SELECT  z# FROM bulk_upload where conf_id  = z! and   delegate_no is not null  ;cS�g|]}t|j��qSr�r,�_mapping�r�rrrrr!��z5BadgeUserModel.bulkuploadPreview1.<locals>.<listcomp>)r:r;r	r<r/rV�allr)rr0rIrJr?rKr@�stmt_1rA�result_2r6rrrr�bulkuploadPreview1�s&


�
��
�z!BadgeUserModel.bulkuploadPreview1cCs�t���Q}z2td|d|dt|�d|d�}|�|���}|r,dd�|D�nd}	|	WWd�StyT}
zt|
�WYd}
~
Wd�Sd}
~
ww1sXwYdS)NrYz FROM z where conf_id  = z and delegate_no in ( z!) and  delegate_no is not null  ;cSrZrr[r]rrrr!�r_z>BadgeUserModel.bulkuploadDublicatePreview2.<locals>.<listcomp>)r:r;r	rVr<r`r)rr0rIrJr?rKr@raZ	results_1r6rrrr�bulkuploadDublicatePreview2�s
,����z*BadgeUserModel.bulkuploadDublicatePreview2cCs4t����}zmtd|dt|�d|d�}|�|�td|d|d|dt|�d	|d�}|�|�}	td
t|�d|dt|�d
t|�d�}
|�|
�|��|	rjWWd�dSWWd�dSty�}zt|�WYd}~Wd�Sd}~ww1s�wYdS)N�DELETE FROM �  where conf_id = z and delegate_no in (�) ;rQrRrSrTz  and delegate_no in (z7insert into badge_role (b_role ,conf_id) (select role, � from � where conf_id = zA and role not in (select b_role from  badge_role where conf_id = z  ) group by role ) ;r#)r:r;r	rVr<r/r)rr0rIrJr?rKr@rArar6Zstmt_3rrrr�bulkuploadSelected�s<
$
4
�����
�����z!BadgeUserModel.bulkuploadSelectedcCslt���(}tdt|�d|d�}|�|�}|��}|r#t|j�ndWd�S1s/wYdS)Nz)select * from conference where conf_id = z and conf_uuid = 'z'   limit 1;�r:r;r	rVr<�one_or_noner,r\)rr0�	conf_uuidr@rAr6�resultrrr�
checkConfUUID��

$�zBadgeUserModel.checkConfUUIDc
Cs�t���M}td|dt|�d|d�}|�|�|��td|d|dt|�d|d	�}|�|���}	|	rFd
d�|	D�nd}	|	Wd�S1sTwYdS)Nrez  where  conf_id = � and delegate_no in  (z ) ;rYz  from riz and delegate_no   in (z)   ;cSrZrr[r]rrrr!�r_z<BadgeUserModel.removeAndGetRemainRecords.<locals>.<listcomp>)r:r;r	rVr<r/r`)
rr0r?rKrJ�remove_delegate_nosr@rArar6rrr�removeAndGetRemainRecords�s
$
,$�z(BadgeUserModel.removeAndGetRemainRecordsc	Cspt���*}td|dt|�d�}|�|���}|r#dd�|D�nd}|Wd�S1s1wYdS)NrYz#  from bulk_upload where conf_id = rUcSrZrr[r]rrrr!�r_z8BadgeUserModel.GetAllRecordsFromFile.<locals>.<listcomp>�r:r;r	rVr<r`)	rr0r?rKrJrrr@rar6rrr�GetAllRecordsFromFile��
$�z$BadgeUserModel.GetAllRecordsFromFilecC�dt���$}td|d�}|�|���}|rdd�|D�nd}|Wd�S1s+wYdS)N�Hselect count(*) as scanned_count , se.session_id , fc.session_name from �V se inner join fc_sessions fc on fc.session_id = se.session_id group by se.session_id;cSrZrr[r]rrrr!�r_z7BadgeUserModel.FcScannedTestRecords.<locals>.<listcomp>�r%r;r	r<r`�rr0�ses_entry_tabler@rar6rrr�FcScannedTestRecords��
$�z#BadgeUserModel.FcScannedTestRecordscCs\t��� }td�}t|�}|�|�|�|�}|��|Wd�S1s'wYdS)NzSET SQL_SAFE_UPDATES = 0�r%r;r	r<r/)r�del_stmtr@�safe_updateZ
del_stmt_1rnrrr�delete_test_record�s


$�z!BadgeUserModel.delete_test_recordcCrw)NzHselect count(*) as scanned_count , se.session_id , kc.session_name from zV se inner join kc_sessions kc on kc.session_id = se.session_id group by se.session_id;cSrZrr[r]rrrr!�r_z7BadgeUserModel.KcScannedTestRecords.<locals>.<listcomp>rzr{rrr�KcScannedTestRecords�r~z#BadgeUserModel.KcScannedTestRecordscCspt���*}td|dt|�d�}|�|���}|r#dd�|D�nd}|Wd�S1s1wYdS)Naselect d.delegate_id ,d.prefix,d.full_name,d.email,d.role,d.delegate_no,cd.delegate_id as cd_delegate_id,cd.prefix as cd_prefix,cd.full_name as cd_full_name,cd.email as cd_email,cd.role as cd_role,cd.delegate_no as cd_delegate_no from delegates d inner join z> cd on cd.delegate_no = d.delegate_no where d.conference_id = z| and d.delegate_no is not null and d.role is not null and d.role <> cd.role and d.email=cd.email order by d.delegate_no asc;cSrZrr[r]rrrr!r_z;BadgeUserModel.get_data_for_role_update.<locals>.<listcomp>rtr>rrr�get_data_for_role_update�rvz'BadgeUserModel.get_data_for_role_updatecC�t���<}td|dt|�dt|�dt|�d|d�}|�|�}|��|r7	Wd�dS	Wd�dS1sCwYdS)	Nzupdate zV cd inner join delegates d on cd. delegate_no  = d.delegate_no and d.conference_id = 'z)' set cd.role = d.role ,cd.updated_at = 'z' where d.conference_id = 'zf' and d.delegate_no is not null and d.role is not null and d.role  <> cd.role and cd.delegate_no  in (rgr#�fail�r:r;r	rVr<r/�rr0r?�delegate_no�
updated_atr@rArnrrr�conf_del_update_in_data�
<
�$�z&BadgeUserModel.conf_del_update_in_datacCr�)	Nzupdate  delegates d inner join z@ cd on cd. delegate_no  = d.delegate_no  and d.conference_id = 'z=' and d.email=cd.email set d.role = cd.role ,d.updated_at = 'z' where d.conference_id = zc and d.delegate_no is not null and d.role is not null and d.role  <> cd.role and d.delegate_no in (�)  ;r#r�r�r�rrr�del_update_in_datar�z!BadgeUserModel.del_update_in_datacCrw)NrxrycSrZrr[r]rrrr!r_z4BadgeUserModel.getbackupscandata.<locals>.<listcomp>rzr{rrr�getbackupscandatar~z BadgeUserModel.getbackupscandatacCrw)NzXselect count(*) as scanned_count , se.session_id , fc.session_name,fc.session_key  from rycSrZrr[r]rrrr!&r_z:BadgeUserModel.getbackupscandatabackup.<locals>.<listcomp>rz)rr0�
fc_back_tabler@rar6rrr�getbackupscandatabackup"r~z&BadgeUserModel.getbackupscandatabackupcCs�g}z^t��}|��}|�d|||g�	dd�|jD�}g}	|��}	|	dur)n
tt||	��}
|�|
�q |�t	|��|�
�durDn|jdurJnqW|��|��|SW|��|��|S|��|��w)NZfc_data_backuprCcSrrrrDrrrr!5r"z0BadgeUserModel.create_backup.<locals>.<listcomp>�
r%r&r'r(r)rFr,r-r+rGrHr/r.)rr0r1�
session_idrLr4r'rMrNrOr7rrr�
create_backup-s>
�
���
zBadgeUserModel.create_backupcCslt���(}tdt|�d|d�}|�|�}|��}|r#t|j�ndWd�S1s/wYdS)Nz(select * from conference where conf_id =z and conf_key = 'z';rk)rr0r1r@rArnrrr�getConfDataSrpzBadgeUserModel.getConfDatacC�ht���&}tdt|�d�}|�|���}|rdd�|D�nd}|Wd�S1s-wYdS)Nz)select * from badge_role where conf_id = �;cSrZrr[r]rrrr!^r_z2BadgeUserModel.getDelegateRole.<locals>.<listcomp>rt�rr0r@rArnr6rrr�getDelegateRoleZ�
$�zBadgeUserModel.getDelegateRolec
C�t��}|��}|�d||||g�|jr>dd�|jD�}g}|��D]}	|�tt||	���q#|�	�|�
�|r<|SdS|�	�|�
�dS)NZ get_delegates_by_role_and_delnoscSrrrrrrrr!fr"z6BadgeUserModel.get_data_for_remove.<locals>.<listcomp>r$)
rr0r?�b_role�all_delegate_nosr4r'r5r6r7rrr�get_data_for_removeas z"BadgeUserModel.get_data_for_removec	Cs�t���9}td|dt|�d|d�}td�}|�|�}|�|�}|��|r4	Wd�dS	Wd�dS1s@wYdS)N�delete from ri� and delegate_id in (r��SET SQL_SAFE_UPDATES = 0 r#r��r%r;r	rVr<r/)	rr0r?�delegate_idsr@rAr�r6rnrrr�removeConfDelegatesByIdszs
$

�
$�z'BadgeUserModel.removeConfDelegatesByIdscC�pt���*}tdt|�d|d�}|�|���}|r#dd�|D�nd}|Wd�S1s1wYdS)NzwSELECT f.session_id,f.session_name,f.session_key,f.start_time,f.end_time,f.is_active from fc_sessions f where conf_id =� and conf_key ='�' ;cSrZrr[r]rrrr!�r_z3BadgeUserModel.getFCSessionData.<locals>.<listcomp>�r%r;r	rVr<r`�rr0r1r@rArnr6rrr�getFCSessionData�rvzBadgeUserModel.getFCSessionDatac
Cr�)NZ get_delegates_by_name_and_delnoscSrrrrrrrr!�r"zABadgeUserModel.get_delegate_nos_by_name_delno.<locals>.<listcomp>r$)
rr0r?�	full_name�delegate_nosr4r'r5r6r7rrr�get_delegate_nos_by_name_delno�s z-BadgeUserModel.get_delegate_nos_by_name_delnocCs*t����}zhtd|dt|�dt|�d�}|�|�}	|	��}	|	j}
td|dt|�d|d|d	t|�d
t|�d|dt|�d
t|
�d�}t|�|�|�}|��WWd�dSt	y�}
zt|
�WYd}
~
Wd�Sd}
~
ww1s�wYdS)NzBselect group_concat(delegate_no separator  ',' ) as del_nos from  z   where conf_id = r�z) limit 1 ;z
INSERT INTO  z- (session_id,delegate_no,created_at )SELECT  z,delegate_no, 'z' FROM  z where delegate_id  in (z) and conf_id = z1 and delegate_no not in (select delegate_no from z where session_id = rqz)  );r#)
r%r;r	rVr<rFrKrr/r)rr0�del_session_table_namer?r�r�r2r@Zdel_nos_stmt�result_1rKrAr6rrrr�insert_custom_delegate_no�s$
(
d
����z(BadgeUserModel.insert_custom_delegate_noc
Cs�t���?}td|dt|�d|dt|�d�}td�}|�|�}|�|�}	|��|	r:	Wd�dS	Wd�dS1sFwYdS)	Nr�z where  session_id = z/  and  delegate_no in (select delegate_no from z where delegate_id =z ) limit 1;r�r#r�r�)
rr?r�r��delegate_idr@rAr�r6rnrrr�remove_custom_delegate_no�s
0

�	$�z(BadgeUserModel.remove_custom_delegate_nocCr�)N�wSELECT f.session_id,f.session_name,f.session_key,f.start_time,f.end_time,f.is_active from kc_sessions f where conf_id =r�r�cSrZrr[r]rrrr!�r_�3BadgeUserModel.getkCSessionData.<locals>.<listcomp>r�r�rrr�getkCSessionData�rvzBadgeUserModel.getkCSessionDatac	Cs�|r=d|vr=t���)}td|d�}|�|�}|r*dd�|D�}|Wd�S	Wd�dS1s6wYdSt���)}td|d�}|�|�}|radd�|D�}|Wd�S	Wd�dS1smwYdS)	N�SIGNUPz�select d.delegate_no,d.full_name,d.email,d.mobile,d.role,d.city,d.state,d.membership_no,d.mc_number,d.signed_on,d.comments,d.signed_by from z d limit 1;cS�"g|]
}tt|j��|j���qSr�r,r-r\r=�rr7rrrr!��"z?BadgeUserModel.getDelegatesColumnForReports.<locals>.<listcomp>zvselect d.delegate_no,d.full_name,d.email,d.mobile,d.role,d.city,d.state,d.membership_no,d.mc_number,d.created_at from z
 d   limit 1;cSr�rr�r�rrrr!�r�)r:r;r	r<r%)	rr0r?r|�report_namer@rArn�recordsrrr�getDelegatesColumnForReports�s&

�$�
	
�$�z+BadgeUserModel.getDelegatesColumnForReportscCs�t��}|��}
|
�d|||||||||	|
|g�|
jrEdd�|
jD�}g}|
��D]}|�tt||���q*|
�	�|�
�|rC|SdS|
�	�|�
�dS)NZusp_get_signup_and_kit_reportcSrrrrrrrr!�r"z8BadgeUserModel.getSignupAndKitReport.<locals>.<listcomp>r$)rr0r?�
group_by_role�group_by_signedon�sel_columns�order_by�
is_count_onlyr�r|�date_1�roler4r'r5r6r7rrr�getSignupAndKitReport�s"z$BadgeUserModel.getSignupAndKitReportc
Cr�)N�usp_get_kc_download_reportcSrrrrrrrr!�r"z7BadgeUserModel.getKITReportDownload.<locals>.<listcomp>)r:r&r'r(r)r*r+r,r-r.r/)
rr�r0�kc_session_entry_table_namer�r4r'r5r6r7rrr�getKITReportDownload�s z#BadgeUserModel.getKITReportDownloadcCrw)Nzselect role from zZ where role not in ('VOLUNTEER' , 'Volunteer','SUPPORT - IT','Support -IT') group by role;cSrZrr[r]rrrr!r_z+BadgeUserModel.get_role.<locals>.<listcomp>rz)rr0r?r@rar6rrr�get_roler~zBadgeUserModel.get_rolecCspt���*}td|dt|�d�}|�|���}|r#dd�|D�nd}|Wd�S1s1wYdS)NzSELECT min(delegate_no) as min_del_number, max(delegate_no) as max_del_number,count(delegate_no)  as total_count, counter from rfzK and counter is not null and counter > 0 group by counter order by counter;cSrZrr[r]rrrr!r_z:BadgeUserModel.get_delegate_no_counter.<locals>.<listcomp>r�)rr0r?r@rArnr6rrr�get_delegate_no_counterrvz&BadgeUserModel.get_delegate_no_countercCszt���/}td|d�}td�}|�|�}|�|�}|��|r*	Wd�dS	Wd�dS1s6wYdS)Nztruncate table r�r�r#r�r)rr?r@rAr�r6rnrrr�truncateConfDelegatess


�	$�z$BadgeUserModel.truncateConfDelegatescCsdt���$}td|d�}|�|���}|rdd�|D�nd}|Wd�S1s+wYdS)N�SELECT * from r9cSrZrr[r]rrrr!+r_z<BadgeUserModel.get_conf_delegate_details.<locals>.<listcomp>rz)rr?r@rArnr6rrr�get_conf_delegate_details'r~z(BadgeUserModel.get_conf_delegate_detailsc	Cs�t���M}|dkr td|d|dt|�d|d�}ntd|d|dt|�d|d�}|�|���}|rFdd	�|D�nd}|Wd�S1sTwYdS)
NrzRSELECT delegate_id,delegate_no,prefix,full_name  as old_name,replace(full_name , 'z','') as new_name from z where conference_id =  z and  full_name like '%z%' and delegate_no is not null;z where conf_id =  cSrZrr[r]rrrr!7r_z7BadgeUserModel.get_delegate_details.<locals>.<listcomp>rt)	rr0r?�name_replace�is_main_del_tabler@rArnr6rrr�get_delegate_details0s
.,$�z#BadgeUserModel.get_delegate_detailscCs�t���`}|dkr$td|d|d|dt|�d|d�}ntd|d|d	|d
t|�d|d�}td�}	|�|	�}
|�|�}|��|r[	Wd�d
S	Wd�dS1sgwYdS)NrzUPDATE  z& SET full_name = replace(full_name , 'z',''),updated_at = 'z' where conference_id = z and  delegate_id in (z) and delegate_no is not null ;z% SET full_name = replace(full_name, 'z','Dr. '),updated_at = 'z' where conf_id = z) and delegate_no is not null;r�r#r�r�)rr?r0r�r�r2r�r@rAr�r6rnrrr�updateConfDelegatesByIds;s
64

�$�z'BadgeUserModel.updateConfDelegatesByIdscCs�t���Y}|r2|dkr2td|dt|�dd�}|�|���}|r)t|j�ndWd�Std|dt|�dd�}|�|���}|rRdd	�|D�nd}|Wd�S1s`wYdS)
Nrz3select count(d.delegate_no) as delegate_count from z d where d.conf_id= z; and d.delegate_no is not null and d.full_name is not null z� and d.role not in ('GUEST OF HONOR','BANQUET - DAY 2','BANQUET - DAY 1', 'EXHIBITOR','TRADE', 'VOLUNTEER', 'Event Crew' , 'TRADE DELEGATE' ,'SUPPORT - IT' , 'Support - AV','AV-TEAM','Photographer' )  limit 1z�select d.delegate_id,d.delegate_no,d.full_name,d.email,d.mobile,d.mc_number,d.membership_no, d.state,d.counter,d.batch,d.role from z� and d.role not in ('GUEST OF HONOR','BANQUET - DAY 2','BANQUET - DAY 1', 'EXHIBITOR','TRADE', 'VOLUNTEER', 'Event Crew' , 'TRADE DELEGATE' ,'SUPPORT - IT' , 'Support - AV','AV-TEAM','Photographer' ) cSrZrr[r]rrrr![r_z8BadgeUserModel.confDelegateNotSignin.<locals>.<listcomp>)	r%r;r	rVr<rlr,r\r`)rr0r?r�r@rArnr6rrr�confDelegateNotSigninMs.
�������$�z$BadgeUserModel.confDelegateNotSignincCs�t��}|��}|�d|||||g�|jr?dd�|jD�}g}	|��D]}
|	�tt||
���q$|�	�|�
�|	r=|	SdS|�	�|�
�dS)NZ"usp_badge_kit_not_collected_reportcSrrrrrrrr!dr"zABadgeUserModel.badge_kit_not_collected_report.<locals>.<listcomp>r$)rr0r?r|�is_badge_not_collect�is_kit_not_collectr4r'r5r6r7rrr�badge_kit_not_collected_report_s z-BadgeUserModel.badge_kit_not_collected_reportcCsxt���.}td|dt|�dt|�d�}|�|�}|��}|r)t|j�ndWd�S1s5wYdS)Nr�z where conf_id =z and delegate_id = z ;)r%r;r	rVr<rlr,r\)rr?r0r�r@rArnrrr�
get_delegatesus
(
$�zBadgeUserModel.get_delegatesc
Cst���r}d}td�}|�|�|��td|d|dt|�d�}|�|���}	|	rm|	j}|dkrdtd|d|d	|dt|�d
�}|�|�|��dt|�dWd�S	Wd�d
S	Wd�d
S1sywYdS)Nrz SET SQL_SAFE_UPDATES = 0 ;z, select count(delegate_no) as count_1 from  z   WHERE role = 'z' and conf_id = z  limit 1; z UPDATE z  set del_no_prefix = 'z' WHERE role = 'z ; z,Successfully updated. Affected row count is �.z There is no records to updated. )r%r;r	r<r/rVrF�count_1)
rr0r?r��
del_no_prefixr@r�rArarnrrr�updateDelNoPrefix~s&

$,
��$�z BadgeUserModel.updateDelNoPrefixcCs�t���2}td|d|dt|�d�}t|�|�|���}|r+dd�|D�nd}|Wd�S1s9wYdS)Nzselect rhriz5 and full_name is not null order by delegate_no asc ;cSrZrr[r]rrrr!�r_z9BadgeUserModel.get_register_delegates.<locals>.<listcomp>)r%r;r	rVrr<r`)rr�r?r0r@rar6rrr�get_register_delegates�s
$$�z%BadgeUserModel.get_register_delegatescCr�)Nz+select * from conf_reports where conf_id = r�cSrZrr[r]rrrr!�r_z0BadgeUserModel.get_email_ids.<locals>.<listcomp>r�r�rrr�
get_email_ids�r�zBadgeUserModel.get_email_idsc
Cs�t��}
|
��}|�d|||||||||	g	�|jrCdd�|jD�}g}
|��D]}|
�tt||���q(|�	�|
�
�|
rA|
SdS|�	�|
�
�dS)NZ%badge_not_collected_but_attended_listcSrrrrrrrr!�r"z9BadgeUserModel.UnsignupButScannedList.<locals>.<listcomp>r$)rr0rKr?�kc_entry_table�fc_entry_table�fcbackup_table�is_bulk_signup�is_view_bulk_signup_data�is_manual_signupr4r'r5r6r7rrr�UnsignupButScannedList�s z%BadgeUserModel.UnsignupButScannedListc
Cs�g}zbt��}	|	��}
|
�d|||||||g�	dd�|
jD�}g}	|
��}
|
dur-n
tt||
��}|�|�q$|�t	|��|
�
�durHn|
jdurNnqW|	��|	��|SW|	��|	��|S|	��|	��w)NZdel_records_from_all_tablerCcSrrrrDrrrr!�r"z:BadgeUserModel.Getsearch_delegate_data.<locals>.<listcomp>r�)rr0rK�search_datar?r�r�r�rLr4r'rMrNrOr7rrr�Getsearch_delegate_data�s>
�
���
z&BadgeUserModel.Getsearch_delegate_datacCr�)Nr�r�r�cSrZrr[r]rrrr!�r_r�r�r�rrrr��rvN)1�__name__�
__module__�__qualname__rr8rBrPrXrcrdrjrorsrur}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrs`7#
			
&			
"r)�
sqlalchemyrrrrrrrr	Zsqlalchemy.sqlr
r�corer�json�configr:r%rrrrr�<module>s(

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists