
    Ѯhl
                        d dgZ ddlmZmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZmZ ddlmZ  ede      Zdee   deeeeee	f      f   dee   fdZ 	 	 dddddddeee   e!e   f   dee   deeeeee	f      f   dee   dee   dee"   dee   defdZ# ed      	 	 dddddddeee   e!e   f   dee   deeeeee	f      f   dee   dee   dee"   dee   defd       Z$y) 	apaginatepaginate    )AnyOptionalTypeVarUnion)Model)Prefetch)QuerySet)
deprecated)AbstractParams)Config)	flow_exprrun_async_flow)generic_flow)AdditionalDataAsyncItemsTransformer   )generic_query_apply_paramsTModel)boundqueryprefetch_relatedreturnc                 t    |r5|du r"g | j                   j                  j                  } | j                  | S | S )NT)model_metafetch_fieldsr   )r   r   s     q/home/www/academy-backend.kofcorporation.com/venv/lib/python3.12/site-packages/fastapi_pagination/ext/tortoise.py_generate_queryr       sC     t#@!2!2!?!?@%u%%'788L    N)transformeradditional_datatotalconfigparamsr"   r#   r$   r%   c                    K   t         t              s j                          t        t	        dt         fd      t         fd      ||||             d {   S 7 w)NTc                  ,     j                         S S N)count)r   r$   s   r   <lambda>zapaginate.<locals>.<lambda>2   s    %- U r!   c                 L    t        t              |       j                         S r)   )r   r    all)
raw_paramsr   r   s    r   r+   zapaginate.<locals>.<lambda>4   s'    #=#E+;<$ #% r!   )async_
total_flowlimit_offset_flowr&   r"   r#   r%   )
isinstancer   r-   r   r   r   r   r&   r   r"   r#   r$   r%   s   ` `  ` r   r   r   "   sd      eX&		 !RS' #+	
   s   AA%A#A%zAUse `apaginate` instead. This function will be removed in v0.15.0c          	      B   K   t        | ||||||       d {   S 7 w)N)r&   r   r"   r#   r$   r%   )r   r3   s          r   r   r   A   s4      )'   s   )NF)%__all__typingr   r   r   r   tortoise.modelsr	   tortoise.query_utilsr
   tortoise.querysetr   typing_extensionsr   fastapi_pagination.basesr   fastapi_pagination.configr   fastapi_pagination.flowr   r   fastapi_pagination.flowsr   fastapi_pagination.typesr   r   utilsr   r   boolliststrr    typeintr   r    r!   r   <module>rG      s  

# 0 0 ! ) & ( 3 , = 1 J -		'
F
D$uS(]';"<<=
 f
 (,@E
 4804#&!4</0^$ D$uS(]';"<<=
 /0 n- C= V 	> OP (,@E
 4804#&!4</0^$ D$uS(]';"<<=
 /0 n- C= V 	 Qr!   