o
    È·e   ã                   @   s    d dl mZ G dd„ deƒZdS )é    )Úsixc                   @   sz   e Zd ZdZddd„Zdd„ Zdd„ Zdd	„ Zddd„Zddd„Z	dd„ Z
dd„ Zddd„Zdd„ Zdd„ ZeeeƒZdS )ÚQueryNc                 C   sJ   || _ || _d| _|r|| _n| j j| _g | _d | _d | _d | _|| _	d S )Nr   )
Úmodel_classÚlimitÚoffsetÚmanagerÚ_managerÚfiltersÚselectÚsort_byÚrsÚ
next_token)Úselfr   r   r   r   © r   úH/var/www/ideatree/venv/lib/python3.10/site-packages/boto/sdb/db/query.pyÚ__init__   s   

zQuery.__init__c                 C   s   t | j | ¡ƒS ©N)Úiterr   Úquery©r   r   r   r   Ú__iter__'   s   zQuery.__iter__c                 C   s   | j d u r
|  ¡ | _ t| j ƒS r   )Ú__local_iter__r   Únextr   r   r   r   r   *   s   


z
Query.nextc                 C   s   | j  ||f¡ | S r   )r	   Úappend)r   Úproperty_operatorÚvaluer   r   r   Úfilter/   s   zQuery.filterr   c                 C   s   || _ || _| S )zmNot currently fully supported, but we can use this
        to allow them to set a limit in a chainable method)r   r   )r   r   r   r   r   r   Úfetch3   s   zQuery.fetchTc                 C   s   | j  | j| j|| j| j¡S r   )r   Úcountr   r	   r   r
   )r   Úquickr   r   r   r   :   s   zQuery.countc                 C   s   | j  | j| j| j| j¡S r   )r   Ú_build_filter_partr   r	   r   r
   r   r   r   r   Ú	get_query=   s   zQuery.get_queryc                 C   s
   || _ | S r   )r   )r   Úkeyr   r   r   Úorder@   s   zQuery.orderc                 C   s.   |s| j  ¡ }| ¡ }| D ]}| |¡ q|S r   )r   Úget_xmlmanagerÚnew_docÚto_xml)r   ÚdocÚ
xmlmanagerÚobjr   r   r   r&   D   s   
zQuery.to_xmlc                 C   s   | j r| j jS | jr| jS d S r   )r   r   Ú_next_tokenr   r   r   r   Úget_next_tokenL   s
   zQuery.get_next_tokenc                 C   s
   || _ d S r   )r*   )r   Útokenr   r   r   Úset_next_tokenS   s   
zQuery.set_next_token)NNN)r   )Tr   )Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r!   r#   r&   r+   r-   Úpropertyr   r   r   r   r   r      s    



r   N)Úboto.compatr   Úobjectr   r   r   r   r   Ú<module>   s    