
    h                     Z   d dl 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  G d de      Z G d	 d
e
e      Z G d de
e      Z G d de
e      Z G d de
e      Z G d de      Z G d de
e      Z G d de
e      Z G d de
e      Z G d de
e      Z G d de      Z G d de
e      Z G d d e	e
e      Z G d! d"e	e
e      Z G d# d$e
e      Z G d% d&e
e      Z G d' d(e
e      Z G d) d*e      Z G d+ d,e      Z G d- d.e
e      Z  G d/ d0e
e      Z! G d1 d2e
e      Z"y)3    N)Func)
FloatFieldIntegerField)Cast)FixDecimalInputMixinNumericOutputFieldMixin)	Transformc                       e Zd ZdZdZy)AbsABSabsN__name__
__module____qualname__functionlookup_name     b/var/www/html/ranktracker/api/venv/lib/python3.12/site-packages/django/db/models/functions/math.pyr   r          HKr   r   c                       e Zd ZdZdZy)ACosACOSacosNr   r   r   r   r   r          HKr   r   c                       e Zd ZdZdZy)ASinASINasinNr   r   r   r   r   r      r   r   r   c                       e Zd ZdZdZy)ATanATANatanNr   r   r   r   r"   r"      r   r   r"   c                       e Zd ZdZdZd Zy)ATan2ATAN2   c           
         t        |j                  dd      r|j                  j                  dk\  r| j                  ||      S | j	                         }|j                  | j                         d d d   D cg c]2  }t        |j                  t              rt        |t                     n|4 c}        |j                  ||fi |S c c}w )N
spatialiteF)   r   r   )getattropsspatial_versionas_sqlcopyset_source_expressionsget_source_expressions
isinstanceoutput_fieldr   r   r   )selfcompiler
connectionextra_contextclone
expressions         r   	as_sqlitezATan2.as_sqlite$   s    z~~|U;z~~?]?]aj?j;;x44 		$$.2.I.I.KDbD.Q&
 * /99P9PR^._DZ\*&
 	 u||HjBMBB	&
s   67CNr   r   r   r   arityr<   r   r   r   r&   r&       s    HECr   r&   c                   &     e Zd ZdZdZ fdZ xZS )CeilCEILINGceilc                 *    t        |   ||fddi|S )Nr   CEILsuperr0   r6   r7   r8   r9   	__class__s       r   	as_oraclezCeil.as_oracle8   s    w~h
UVU}UUr   r   r   r   r   r   rI   __classcell__rH   s   @r   r@   r@   4   s    HKV Vr   r@   c                       e Zd ZdZdZy)CosCOScosNr   r   r   r   rN   rN   <   r   r   rN   c                   &     e Zd ZdZdZ fdZ xZS )CotCOTcotc                 *    t        |   ||fddi|S )Ntemplatez(1 / TAN(%(expressions)s))rE   rG   s       r   rI   zCot.as_oracleE   s     w~h
k=Yk]jkkr   rJ   rL   s   @r   rR   rR   A   s    HKl lr   rR   c                   &     e Zd ZdZdZ fdZ xZS )DegreesDEGREESdegreesc                 L    t        |   ||fddt        j                  z  i|S )NrV   z((%%(expressions)s) * 180 / %s)rF   r0   mathpirG   s       r   rI   zDegrees.as_oracleM   4    w~j
6@
 
 	
r   rJ   rL   s   @r   rX   rX   I       HK
 
r   rX   c                       e Zd ZdZdZy)ExpEXPexpNr   r   r   r   rb   rb   U   r   r   rb   c                       e Zd ZdZdZy)FloorFLOORfloorNr   r   r   r   rf   rf   Z       HKr   rf   c                       e Zd ZdZdZy)LnLNlnNr   r   r   r   rk   rk   _   s    HKr   rk   c                       e Zd ZdZdZd Zy)LogLOGr(   c                     t        |j                  dd      s| j                  ||      S | j                         }|j	                  | j                         d d d           |j                  ||fi |S )Nr*   Fr,   )r-   r.   r0   r1   r2   r3   )r6   r7   r8   r9   r:   s        r   r<   zLog.as_sqliteh   sh    z~~|U;;;x44 		$$T%@%@%B4R4%HIu||HjBMBBr   Nr=   r   r   r   ro   ro   d   s    HECr   ro   c                       e Zd ZdZdZy)ModMODr(   Nr   r   r   r   r>   r   r   r   rs   rs   r   s    HEr   rs   c                   &     e Zd ZdZdZ fdZ xZS )PiPIr   c                 X    t        |   ||fdt        t        j                        i|S )NrV   )rF   r0   strr]   r^   rG   s       r   rI   zPi.as_oracle{   s&    w~h
[S\[][[r   )r   r   r   r   r>   rI   rK   rL   s   @r   rw   rw   w   s    HE\ \r   rw   c                       e Zd ZdZdZy)PowerPOWERr(   Nru   r   r   r   r|   r|      s    HEr   r|   c                   &     e Zd ZdZdZ fdZ xZS )RadiansRADIANSradiansc                 L    t        |   ||fddt        j                  z  i|S )NrV   z((%%(expressions)s) * %s / 180)r\   rG   s       r   rI   zRadians.as_oracle   r_   r   rJ   rL   s   @r   r   r      r`   r   r   c                       e Zd ZdZdZy)RoundROUNDroundNr   r   r   r   r   r      ri   r   r   c                       e Zd ZdZdZy)SignSIGNsignNr   r   r   r   r   r      r   r   r   c                       e Zd ZdZdZy)SinSINsinNr   r   r   r   r   r      r   r   r   c                       e Zd ZdZdZy)SqrtSQRTsqrtNr   r   r   r   r   r      r   r   r   c                       e Zd ZdZdZy)TanTANtanNr   r   r   r   r   r      r   r   r   )#r]   django.db.models.expressionsr   django.db.models.fieldsr   r   django.db.models.functionsr   !django.db.models.functions.mixinsr   r   django.db.models.lookupsr	   r   r   r   r"   r&   r@   rN   rR   rX   rb   rf   rk   ro   rs   rw   r|   r   r   r   r   r   r   r   r   r   <module>r      sf    - < + /) 
"I 
"I 
"I 
C#T C(V9 V
!9 
l
!9 l	
%y 	

!9 
I 
	 ) 
C
 7 C
 7 
\	 $ \#T 
	
%y 	
I 
9 

!9 
"I 

!9 r   