o
    |g'                     @   s   d dl Z d dlmZmZmZmZmZmZmZ d dl	m
Z
 d dlmZ G dd deZG dd deZG d	d
 d
eZG dd deZdS )    N)	TIMESTAMPBooleanColumn
ForeignKeyIntegerStringText)relationship)Basec                   @   s   e Zd ZdZdZeedddZeeddddZ	eeddd	Z
eeddd	Zeed
ZeedZeedZeeedZeeddZeeddd	ZeedddZeedZeeddZeedZeedde dZeedde dZedddZedd Z dd Z!dS )BuyersTargetsInfozBuyers targets sql modelbuyers_targets_infoTprimary_keyautoincrement   F)nullableuniquei  r   i  i  zbuyers_targets_record_type.idCURRENT_TIMESTAMPserver_defaultr   onupdatedefaultr   r   BuyersTargetsRecordTypeback_populatesc                    0   | di |dt  i}||I dH }|S )z
        Insert a new record into the buyers_targets_info table using MySQLDB's execute_insert.

        :param db: An instance of MySQLDB
        :param kwargs: Dictionary of column values for the new record
        
created_byN socketgethostnameexecute_insertclsdbkwargs
new_recordrecordr!   r!   </var/www/html/XCapMarket/services/sql/buyers_targets_info.pyinsert_new_record$      z#BuyersTargetsInfo.insert_new_recordc                 C   s>   | j | j| j| j| j| j| j| j| j| j	| j
| j| j| jdS )!Convert the class to a dictionaryid
company_idcompany_url
project_iddescription	rationalelogo_urlrecord_type_id
created_at
updated_atnotes	is_activecompany_namecategory_namer0   selfr!   r!   r,   to_dict3   s   zBuyersTargetsInfo.to_dictN)"__name__
__module____qualname____doc____tablename__r   r   r1   r   r2   r3   r4   r5   r6   r7   r   r8   r   r9   r=   r:   r;   r   r<   r>   r#   r$   r    modified_byr	   record_typeclassmethodr-   rA   r!   r!   r!   r,   r   	   s6    
r   c                   @   s   e Zd ZdZdZeedddZeedddZ	eedddZ
eedddZeedddZeedddZed	d
dZdd ZdS )r   z$Buyers targets record type sql modelbuyers_targets_record_typeTr   r   Fr      r   rH   r   c                 C   s   | j | j| j| j| j| jdS )r/   r1   record_type_namelabel
subHeading	pitchType
searchTyperL   r?   r!   r!   r,   rA   V   s   zBuyersTargetsRecordType.to_dictN)rB   rC   rD   rE   rF   r   r   r1   r   rM   rN   rO   rP   rQ   r	   r   rA   r!   r!   r!   r,   r   G   s    r   c                   @   s   e Zd ZdZdZeedddZeedddZ	ee
ddZeeddZeed	d
Zeed	d	dZeedde dZeedde dZedd Zdd ZdS )BuyerCompanyRecordzBuyer company record sql modelbuyer_company_recordTr   rK   Fr   r   r   r   r   r   r   c                    r   )z
        Insert a new record into the buyer_company_record table using MySQLDB's execute_insert.

        :param db: An instance of MySQLDB
        :param kwargs: Dictionary of column values for the new record
        r    Nr!   r"   r&   r!   r!   r,   r-   y   r.   z$BuyerCompanyRecord.insert_new_recordc              	   C   s&   | j | j| j| j| j| j| j| jdS )r/   r1   r2   company_datar<   r9   r:   r    rG   rT   r?   r!   r!   r,   rA      s   zBuyerCompanyRecord.to_dictN)rB   rC   rD   rE   rF   r   r   r1   r   r2   r   rU   r   r<   r   r9   r:   r#   r$   r    rG   rI   r-   rA   r!   r!   r!   r,   rR   b   s0    
rR   c                   @   s~   e Zd ZdZeedddZeeddZeeddZee	dddZ
eeddZeeddZeeddZedd Zd	d
 ZdS )BuyersPeopleInfobuyers_people_infoTr   r   r   Fc                    s<   | di |}| | | I d H  ||I d H  |S )Nr!   )addcommitrefresh)r'   r(   r)   r*   r!   r!   r,   r-      s   
z"BuyersPeopleInfo.insert_new_recordc                 C   s"   | j | j| j| j| j| j| jdS )NIDbuyers_targets_info_IDApolloCompany_IDselected_people_ids
company_IDrU   people_countr[   r?   r!   r!   r,   rA      s   zBuyersPeopleInfo.to_dictN)rB   rC   rD   rF   r   r   r\   r]   r^   r   r_   r   r`   ra   rU   rI   r-   rA   r!   r!   r!   r,   rV      s    
rV   )r#   
sqlalchemyr   r   r   r   r   r   r   sqlalchemy.ormr	   utils.mysql_dbr
   r   r   rR   rV   r!   r!   r!   r,   <module>   s    $>4