o
    ‹¨Êhg  ã                   @   sH   d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd„ deƒZ	dS )	zÂ
    pyexcel.plugins.sources.querysets
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Representation of querysets

    :copyright: (c) 2015-2017 by Onni Software Ltd.
    :license: New BSD License
é    N)ÚAbstractSource)ÚQuerysetsReaderé   )Úparamsc                   @   sR   e Zd ZdZejejgZej	fZ
ejfZg Z								d	dd„Zdd„ ZdS )
ÚSheetQuerySetSourcez_
    Database query set as data source

    SQLAlchemy and Django query sets are supported
    Nr   éÿÿÿÿc                 K   s‚   || _ | j d u rtj| _ || _|| _|| _|| _|| _|	| _|d u r&t	dƒ |d u r.t	dƒ |
d u r6t	dƒ t
j| fi |¤Ž d S )Nzstart_column is ignoredzcolumn_limit is ignoredzskip_column_func is ignored)Ú _SheetQuerySetSource__sheet_nameÚ	constantsÚDEFAULT_SHEET_NAMEÚ"_SheetQuerySetSource__column_namesÚ _SheetQuerySetSource__query_setsÚ"_SheetQuerySetSource__row_rendererÚ_SheetQuerySetSource__start_rowÚ_SheetQuerySetSource__row_limitÚ#_SheetQuerySetSource__skip_row_funcÚprintr   Ú__init__)ÚselfÚcolumn_namesÚ
query_setsÚ
sheet_nameÚrow_rendererÚ	start_rowÚ	row_limitÚstart_columnÚcolumn_limitÚskip_row_funcÚskip_column_funcÚkeywords© r   úS/var/www/html/env/lib/python3.10/site-packages/pyexcel/plugins/sources/querysets.pyr      s    
zSheetQuerySetSource.__init__c                 C   sP   t | j| j| jd�}| jd ur| j|d< t| j| jfi |¤Ž}| ¡ }| j	|iS )N)r   r   r   r   )
Údictr   r   r   r   r   r   r   Úto_arrayr   )r   Úlocal_paramsÚreaderÚdatar   r   r    Úget_data=   s   ý

ÿÿ
zSheetQuerySetSource.get_data)NNr   r   NNNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚCOLUMN_NAMESÚ
QUERY_SETSÚfieldsr	   ÚSHEETÚtargetsÚREAD_ACTIONÚactionsÚ
attributesr   r&   r   r   r   r    r      s     
õ r   )
r*   Úpyexcel.constantsr	   Úpyexcel.sourcer   Úpyexcel_io.database.querysetsr   Ú r   r   r   r   r   r    Ú<module>   s    	