ó
    ¼Rj½Á ã                   ó  • S r SSKrSSKrSSKrSSKrSSKJrJr  SSKJ	r	J
r
  SSKJrJrJr  SSKJr  SSKJrJr  SSKJrJrJr  SS	KJr  SS
KJr  SSKJrJrJrJ r J!r!J"r"J#r#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,J-r-J.r.  SSK/J0r0J1r1J2r2J3r3  SSK4J5r5J6r6J7r7J8r8  SSK9J:r:J;r;J<r<J=r=J>r>  SSK?J@r@  SSKAJBrB  SSKCJDrD  SS/rE\B" S5      rF\B" S5      rGS rHS rI\" SS5      rJ " S S5      rK\" SS 5      rL " S! S\5      rMS%S" jrN " S# S$5      rOg)&aW  
Create SQL statements for QuerySets.

The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get the information it needs.
é    N)ÚCounterÚ
namedtuple)ÚIteratorÚMapping)ÚchainÚcountÚproduct)Úascii_uppercase)ÚFieldDoesNotExistÚ
FieldError)ÚDEFAULT_DB_ALIASÚNotSupportedErrorÚconnections)ÚCount)Ú
LOOKUP_SEP)ÚBaseExpressionÚColÚExistsÚFÚOuterRefÚRefÚResolvedOuterRefÚValue)ÚField)ÚMultiColSource)ÚLookup)ÚQÚcheck_rel_lookup_compatibilityÚrefs_expression)ÚINNERÚLOUTERÚ	ORDER_DIRÚSINGLE)Ú	BaseTableÚEmptyÚJoinÚ	MultiJoin)ÚANDÚORÚ
ExtraWhereÚNothingNodeÚ	WhereNode)Úcached_property)Ú_lazy_re_compile)ÚNodeÚQueryÚRawQueryz['`\"\]\[;\s]|--|/\*|\*/z[\w\-]+c                 ó„   • U c
  [        5       $ [        [        R                  " S U R                  5        5       5      5      $ )Nc              3   óŒ   #   • U  H:  oR                   (       a  UR                  UR                  4OUR                  4v •  M<     g 7f©N)ÚconcreteÚnameÚattname©Ú.0Úfs     ÚFD:\diplom_project\venv\Lib\site-packages\django/db/models/sql/query.pyÚ	<genexpr>Ú,get_field_names_from_opts.<locals>.<genexpr>>   s0   é € ð 
ÚFWÀ§:§:ˆQ�V‰V�Q—Y‘YÑ°A·F±F°9Ô<ÒFWùs   ‚AA)Úsetr   Úfrom_iterableÚ
get_fields)Úoptss    r;   Úget_field_names_from_optsrB   :   s=   € Ø�|Ü‹uˆÜÜ×Òñ 
ØFJÇoÁoÔFWó
ó 	
óð ó    c              #   ó’   #   • U R                    H1  n[        U[        5      (       a  [        U5       S h  v•N   M-  Uv •  M3     g  N7fr4   )ÚchildrenÚ
isinstancer/   Úget_children_from_q)ÚqÚchilds     r;   rG   rG   D   s6   é € Ø—”ˆÜ�eœT×"Ñ"Ü*¨5Ó1×1Ò1àŒKò	 á1ùs   ‚3AµA¶AÚJoinInfo)Úfinal_fieldÚtargetsrA   ÚjoinsÚpathÚtransform_functionc                   ó\   • \ rS rSrSrSS jrS rS rS rS r	S r
\S	 5       rS
 rS rSrg)r1   éR   zA single raw SQL query.c                 óp   • X0l         Xl        X l        S U l        Su  U l        U l        0 U l        0 U l        g )N©r   N)ÚparamsÚsqlÚusingÚcursorÚlow_markÚ	high_markÚextra_selectÚannotation_select)ÚselfrU   rV   rT   s       r;   Ú__init__ÚRawQuery.__init__U   s8   € ØŒØŒØŒ
ØˆŒð )0Ñ%ˆŒ�t”~ØˆÔØ!#ˆÕrC   c                 ó$   • U R                  U5      $ r4   )Úclone©r\   rV   s     r;   r   ÚRawQuery.chaina   s   € Ø�z‰z˜%Ó Ð rC   c                 ó>   • [        U R                  XR                  S9$ )N)rT   )r1   rU   rT   ra   s     r;   r`   ÚRawQuery.cloned   s   € Ü˜Ÿ™ %·±Ñ<Ð<rC   c                 óò   • U R                   c  U R                  5         [        U R                     R                  R
                  nU R                   R                   Vs/ s H  o!" US   5      PM     sn$ s  snf ©Nr   )rW   Ú_execute_queryr   rV   ÚintrospectionÚidentifier_converterÚdescription)r\   Ú	converterÚcolumn_metas      r;   Úget_columnsÚRawQuery.get_columnsg   s_   € Ø�;‰;ÑØ×ÑÔ!Ü §
¡
Ñ+×9Ñ9×NÑNˆ	Ø=A¿[¹[×=TÒ=TÓUÒ=T¨k�	˜+ a™.Ö)Ñ=TÑUÐUùÒUs   ÁA4c                 óÔ   • U R                  5         [        U R                     R                  R                  (       d  [        U R                  5      nOU R                  n[        U5      $ r4   )rg   r   rV   ÚfeaturesÚcan_use_chunked_readsÚlistrW   Úiter)r\   Úresults     r;   Ú__iter__ÚRawQuery.__iter__m   sK   € ð 	×ÑÔÜ˜4Ÿ:™:Ñ&×/Ñ/×E×Eô ˜$Ÿ+™+Ó&‰Fà—[‘[ˆFÜ�F‹|ÐrC   c                 ó@   • SU R                   R                  < SU < S3$ )NÚ<z: Ú>)Ú	__class__Ú__name__©r\   s    r;   Ú__repr__ÚRawQuery.__repr__y   s   � Ø!Ÿ^™^×4Ô4³dÐ;Ð;rC   c                 ót   • U R                   c  g [        U R                   [        5      (       a  [        $ [        $ r4   )rT   rF   r   ÚdictÚtupler|   s    r;   Úparams_typeÚRawQuery.params_type|   s*   € à�;‰;ÑØÜ! $§+¡+¬w×7Ñ7ŒtÐB¼UÐBrC   c                 ó„   • U R                   c  U R                  $ U R                  U R                  U R                  5      -  $ r4   )r‚   rU   rT   r|   s    r;   Ú__str__ÚRawQuery.__str__‚   s5   € Ø×ÑÑ#Ø—8‘8ˆOØ�x‰x˜$×*Ñ*¨4¯;©;Ó7Ñ7Ð7rC   c                 óê  ^• [         U R                     nU R                  nUR                  R                  mU[
        L a   [        U4S jU R                   5       5      nOSU[        L a6  U R                  R                  5        VVs0 s H  u  pEUT" U5      _M     nnnOUc  S nO[        SU-  5      eUR                  5       U l
        U R                  R                  U R                  U5        g s  snnf )Nc              3   ó4   >#   • U  H  nT" U5      v •  M     g 7fr4   © )r9   ÚvalÚadapters     €r;   r<   Ú*RawQuery._execute_query.<locals>.<genexpr>�   s   øé € Ð?²;¨C™7 3Ÿ<˜<²;ùs   ƒzUnexpected params type: %s)r   rV   r‚   ÚopsÚadapt_unknown_valuer�   rT   r€   ÚitemsÚRuntimeErrorrW   ÚexecuterU   )r\   Ú
connectionr‚   rT   ÚkeyrŠ   r‹   s         @r;   rg   ÚRawQuery._execute_query‡   sË   ø€ Ü  §¡Ñ,ˆ
ð ×&Ñ&ˆØ—.‘.×4Ñ4ˆØœ%ÒÜÔ?°4·;²;Ó?Ó?‰FØœDÒ Ø8<¿¹×8IÑ8IÔ8KÔLÒ8K©H¨C�c™7 3›<Ò'Ñ8KˆFÑLˆFØÑ Ø‰FäÐ;¸kÑIÓJÐJà ×'Ñ'Ó)ˆŒØ�‰×Ñ˜DŸH™H fÕ-ùó Ms   ÂC/)r[   rW   rZ   rY   rX   rT   rU   rV   N)r‰   )r{   Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r]   r   r`   rm   ru   r}   Úpropertyr‚   r…   rg   Ú__static_attributes__r‰   rC   r;   r1   r1   R   sD   † Ù!ô
$ò!ò=òVò
ò<ð ñCó ðCò
8õ
.rC   ÚExplainInfo)ÚformatÚoptionsc                   ó¼  • \ rS rSrSrSrSr\" \/5      rSr	\
r\rSrSrSrSrSrSrSrSrS	rSrSrSrSrSrSrSrSrSrSr S
r!Sr"Sr#Sr$Sr%Sr&Sr'Sr(Sr)Sr*Sr+\" 5       S4r,Sr-SgS jr.\/S 5       r0\1S 5       r2S r3S r4S r5ShS jr6S r7S r8SiS jr9S r:S r;S r<S r=S r>SgS jr?S r@SiS jrAS rBSiS jrCSiS jrDS  rESjS! jrFS" rGSkS# jrHS$ rIS% rJS& rKS' rLSiS( jrMS) rNS* rOSlS+ jrPS, rQS- rRSgS. jrSS/ rTS0 rUSiS1 jrVS2 rWS3 rXSmS4 jrYS5 rZS6 r[S7 r\S8 r]S9 r^        SnS: jr_S; r`S< raS= rbS> rc      SoS? jrd SpS@ jreSA rfSqSB jrg   SrSC jrhSD ri\jSsSE j5       rk\jSF 5       rlStSG jrmSH rnSI roSJ rpSuSK jrqSL rr\/SM 5       rsSN rtSO ruSP rvSQ rwSR rxSS ryST rzSgSU jr{SV r|SsSW jr}SgSX jr~SY rSZ r€S[ r�S\ r‚S] rƒS^ r„S_ r…S` r†Sa r‡\/Sb 5       rˆ\/Sc 5       r‰Sd rŠSe r‹SfrŒg)vr0   éž   zA single SQL query.ÚTNÚSQLCompilerTFr‰   r   é   c                 óº   • Xl         0 U l        0 U l        X l        0 U l        0 U l        [        5       U l        [        5       U l	        0 U l
        0 U l        0 U l        g r4   )ÚmodelÚalias_refcountÚ	alias_mapÚ
alias_colsÚexternal_aliasesÚ	table_mapr>   Úused_aliasesr,   ÚwhereÚannotationsÚextraÚ_filtered_relations)r\   r¤   r§   s      r;   r]   ÚQuery.__init__ç   sZ   € ØŒ
Ø ˆÔð ˆŒà$Œð
 !#ˆÔØˆŒÜ›EˆÔä“[ˆŒ
àˆÔð ˆŒ
à#%ˆÕ rC   c                 ó2  • [        U R                  5      S:X  a/  U R                  S   n[        USS 5      =(       d    UR                  $ [        U R                  5      S:X  a6  [        [        U R                  R                  5       5      5      R                  $ g )Né   r   Útarget)	ÚlenÚselectÚgetattrÚfieldr[   Únextrs   ÚvaluesÚoutput_field)r\   r´   s     r;   r¹   ÚQuery.output_field  su   € äˆt�{‰{Ó˜qÓ Ø—[‘[ ‘^ˆFÜ˜6 8¨TÓ2×B°f·l±lÐBÜ�×'Ñ'Ó(¨AÓ-Üœ˜T×3Ñ3×:Ñ:Ó<Ó=Ó>×KÑKÐKð .rC   c                 ó.   • U R                    H  nUs  $    g r4   )r¦   ©r\   Úaliass     r;   Ú
base_tableÚQuery.base_table  s   € à—^”^ˆEØŠLò $rC   c                 ó.   • U R                  5       u  pX-  $ )a   
Return the query as a string of SQL with the parameter values
substituted in (use sql_with_params() to see the unsubstituted string).

Parameter values won't necessarily be quoted correctly, since that is
done by the database interface at execution time.
)Úsql_with_params)r\   rU   rT   s      r;   r…   ÚQuery.__str__  s   € ð ×*Ñ*Ó,‰ˆØ‰|ÐrC   c                 óH   • U R                  [        5      R                  5       $ )z_
Return the query as an SQL string and the parameters that will be
substituted into the query.
)Úget_compilerr   Úas_sqlr|   s    r;   rÁ   ÚQuery.sql_with_params  s   € ð
 × Ñ Ô!1Ó2×9Ñ9Ó;Ð;rC   c                 ó@   • U R                  5       nX![        U 5      '   U$ )z4Limit the amount of work when a Query is deepcopied.)r`   Úid)r\   Úmemort   s      r;   Ú__deepcopy__ÚQuery.__deepcopy__"  s   € à—‘“ˆØŒR�‹X‰ØˆrC   c                 óœ   • Uc  Uc  [        S5      eU(       a	  [        U   nUR                  R                  U R                  5      " XX5      $ )NzNeed either using or connection)Ú
ValueErrorr   r�   Úcompiler)r\   rV   r’   Úelide_emptys       r;   rÄ   ÚQuery.get_compiler(  sJ   € Ø‰=˜ZÑ/ÜÐ>Ó?Ð?ÞÜ$ UÑ+ˆJØ�~‰~×&Ñ& t§}¡}Ô5Ø˜eó
ð 	
rC   c                 óR   • U R                   (       a  U R                   R                  $ g)z˜
Return the Options instance (the model._meta) from which to start
processing. Normally, this is self.model._meta, but it can be changed
by subclasses.
N)r¤   Ú_metar|   s    r;   Úget_metaÚQuery.get_meta1  s    € ð �:�:Ø—:‘:×#Ñ#Ð#ð rC   c                 óX  • [        5       nU R                  Ul        U R                  R                  5       Ul        U R                  R                  5       Ul        U R
                  R                  5       Ul        U R                  R                  5       Ul        U R                  R                  5       Ul        U R                  R                  5       Ul        U R                  R                  5       Ul
        U R                  b  U R                  R                  5       Ul        U R                  (       a8  [        U R                   Vs/ s H  o"R                  5       PM     sn5      Ul        SUl        U R                  R                  5       Ul        U R                   b  U R                   R                  5       Ul        U R"                  b  U R"                  R                  5       Ul        U R$                  SLa%  [        R&                  " UR$                  5      Ul        SU R                  ;   a  U R(                  R                  5       Ul        U R*                  R                  5       Ul        U R,                  R                  5       Ul        UR                  R/                  SS5        U$ s  snf )zN
Return a copy of the current Query. A lightweight alternative to
deepcopy().
NFÚsubq_aliasesr¾   )r%   rz   Ú__dict__Úcopyr¥   r¦   r¨   r©   r«   r`   r¬   Úannotation_select_maskÚcombined_queriesr�   Ú_annotation_select_cacher­   Úextra_select_maskÚ_extra_select_cacheÚselect_relatedÚdeepcopyrÖ   rª   r®   Úpop)r\   ÚobjÚquerys      r;   r`   ÚQuery.clone:  sú  € ô
 ‹gˆØŸ™ˆŒà—}‘}×)Ñ)Ó+ˆŒà!×0Ñ0×5Ñ5Ó7ˆÔØŸ™×+Ñ+Ó-ˆŒØ#×4Ñ4×9Ñ9Ó;ˆÔØŸ™×+Ñ+Ó-ˆŒØ—J‘J×$Ñ$Ó&ˆŒ	Ø×*Ñ*×/Ñ/Ó1ˆŒØ×&Ñ&Ñ2Ø)-×)DÑ)D×)IÑ)IÓ)KˆCÔ&Ø× × Ü#(Ø,0×,AÒ,AÓBÒ,A 5—‘–Ñ,AÑBó$ˆCÔ ð (,ˆÔ$Ø—J‘J—O‘OÓ%ˆŒ	Ø×!Ñ!Ñ-Ø$(×$:Ñ$:×$?Ñ$?Ó$AˆCÔ!Ø×#Ñ#Ñ/Ø&*×&>Ñ&>×&CÑ&CÓ&EˆCÔ#Ø×Ñ eÒ+ô "&§¢¨s×/AÑ/AÓ!BˆCÔØ˜TŸ]™]Ó*Ø#×0Ñ0×5Ñ5Ó7ˆCÔØ×,Ñ,×1Ñ1Ó3ˆÔØ"&×":Ñ":×"?Ñ"?Ó"AˆÔà�‰×Ñ˜ tÔ,Øˆ
ùò/ Cs   ÅJ'c                 óð   • U R                  5       nU(       a  UR                  U:w  a  Xl        UR                  (       d  [        5       Ul        SUl        [        US5      (       a  UR                  5         U$ )zŒ
Return a copy of the current Query that's ready for another operation.
The klass argument changes the type of the Query, e.g. UpdateQuery.
FÚ_setup_query)r`   rz   Úfilter_is_stickyr>   rª   Úhasattrrå   )r\   Úklassrá   s      r;   r   ÚQuery.chaing  s[   € ð
 �j‰j‹lˆÞ�S—]‘] eÓ+Ø!ŒMØ×#×#Ü"›uˆCÔØ$ˆÔÜ�3˜×'Ñ'Ø×ÑÔØˆ
rC   c                 óH   • U R                  5       nUR                  U5        U$ r4   )r`   Úchange_aliases)r\   Ú
change_mapr`   s      r;   Úrelabeled_cloneÚQuery.relabeled_clonev  s    € Ø—
‘
“ˆØ×Ñ˜ZÔ(ØˆrC   c                 óJ   • U R                   (       d  S nUR                  X25      $ r4   ©r§   Úget_col)r\   r²   r¶   r½   s       r;   Ú_get_colÚQuery._get_col{  s   € Ø��ØˆEØ�~‰~˜eÓ+Ð+rC   c                 óf  ^ • U(       d  0 $ SnSn0 nT R                   nUR                  5        HÒ  u  pxT R                  U5        UR                  T SSSS9n	U	R                  (       d  [        SU-  5      eT R                  U/5        U[        U 4S jU	R                  5        5       5      -  nU[        U 4S jU	R                  5        5       5      -  nU	R                  U5      n	U	T R                  U'   X•[        Xy5      '   MÔ     U Vs0 s H  owT R                  R                  U5      _M      n
nT R                  U5        T R                  R                  5       u  p¼n[        S T R                  R!                  5        5       5      =(       d    Un[#        T R$                  [&        5      (       dP  T R(                  (       d?  U(       d8  U(       d1  U(       d*  U(       d#  T R*                  (       d  T R,                  (       Gaä  S	S
KJn  T R3                  5       nSUl        U" T R6                  U5      nSUl        SUl        UR                  T R<                  5        UR?                  SS9  UR*                  (       Gd?  UR@                  (       aJ  U(       aC  T R6                  RB                  RD                  RG                  URI                  5       5      4Ul        SUl         U(       dÖ  [K        5       n[#        T R$                  [&        5      (       a&  T R$                   H  nUUR                  5       -  nM     U
R!                  5        H  n	UU	R                  5       -  nM     T R<                  R                  5        H.  u  nnURM                  5       (       d  M  URO                  U5        M0     UR                  U5        0 nU
R                  5        HŸ  u  py0 nT RQ                  U	/SS9 He  nURS                  U5      =n(       dE  [U        U5      S-   nSU 3n[        UU5      nUUU'   UUR                  U'   UR                  U/5        UUU'   Mg     U	R                  U5      UR                  U'   M¡     URV                  S:X  ae  UR@                  (       dT  UR                   (       dC  T R6                  RB                  RD                  RG                  URI                  5       5      4Ul+        O´T nST l+        ST l         0 T l,        T R                  (       at  T R                  R                  5        VVs0 s H  u  nn[        UU5      U_M     nnnU
R                  5        VV	s0 s H  u  pyXyR                  U5      _M     sn	nT l
        OU
T l
        T R                  U
5        UR<                  R!                  5        Vs/ s H  nURZ                  PM     nn[        S U 5       5      (       + nUR?                  SS9  UR]                  5         SUl        SUl        UR_                  UUS9nURa                  [b        5      nUc  UnOEURe                  UR<                  R!                  5       5      n [g        URi                  U4U 5      5      n[k        [m        UR<                  U5      5      $ s  snf s  snnf s  sn	nf s  snf )zE
Return the dictionary with the values of the existing aggregations.
FTN)Úallow_joinsÚreuseÚ	summarizez!%s is not an aggregate expressionc              3   óX   >#   • U  H  n[        TR                  U   S S5      v •  M!     g7f)Úcontains_subqueryFN©rµ   r¬   ©r9   Úrefr\   s     €r;   r<   Ú(Query.get_aggregation.<locals>.<genexpr>–  s0   øé € ð !â/�Cô ˜×(Ñ(¨Ñ-Ð/BÀE×JÐJÚ/ùó   ƒ'*c              3   óX   >#   • U  H  n[        TR                  U   S S5      v •  M!     g7f)Úcontains_over_clauseTNrú   rû   s     €r;   r<   rý   š  s0   øé € ð â/�Cô ˜×(Ñ(¨Ñ-Ð/EÀt×LÐLÚ/ùrþ   c              3   ó<   #   • U  H  n[        US S5      v •  M     g7f)Úcontains_aggregateTN)rµ   )r9   Ú
annotations     r;   r<   rý   ©  s$   é € ð â";�Jô ˜
Ð$8¸$×?Ð?Ú";ùs   ‚r   )ÚAggregateQuery©Úforce)Úresolve_refsr±   Ú__colr‰   c              3   ó0   #   • U  H  o[         L v •  M     g 7fr4   )ÚNotImplemented)r9   rt   s     r;   r<   rý   $  s   é € ÐVÒEU¸6¬Õ6ÒEUùs   ‚)rÏ   )7rÙ   r�   Úcheck_aliasÚresolve_expressionr  Ú	TypeErrorÚappend_annotation_maskÚanyÚget_refsÚreplace_expressionsr¬   r   rà   Úset_annotation_maskr«   Úsplit_having_qualifyr¸   rF   Úgroup_byr�   Ú	is_slicedÚdistinctÚ
combinatorÚdjango.db.models.sql.subqueriesr  r`   Úsubqueryr¤   Úselect_for_updaterÞ   r[   Úclear_orderingÚdefault_colsrÒ   Úpkrñ   Úget_initial_aliasr>   Úget_group_by_colsÚaddÚ	_gen_colsÚgetr³   r´   r­   Úempty_result_set_valueÚclear_limitsrÄ   Úexecute_sqlr#   Úget_convertersr·   Úapply_convertersr€   Úzip)!r\   rV   Úaggregate_exprsÚrefs_subqueryÚrefs_windowÚreplacementsrÙ   r½   Úaggregate_exprÚ	aggregateÚ
aggregatesÚ_ÚhavingÚqualifyÚhas_existing_aggregationr  Úinner_queryÚouter_queryÚannotation_maskÚexprÚannotation_aliasr  Úcol_refsÚcolÚcol_refÚindexÚ	col_aliasÚ
expressionÚempty_set_resultrÏ   rÎ   rt   Ú
converterss!   `                                r;   Úget_aggregationÚQuery.get_aggregation€  s#  ø€ ö ØˆIð ˆØˆØˆØ!%×!<Ñ!<ÐØ%4×%:Ñ%:Ö%<Ñ!ˆEØ×Ñ˜UÔ#Ø&×9Ñ9Ø $¨d¸dð :ð ˆIð ×/×/ÜÐ CÀeÑ KÓLÐLð ×'Ñ'¨¨Ô0ØœSô !à$×-Ñ-Ô/ó!ó ñ ˆMð œ3ô à$×-Ñ-Ô/óó ñ ˆKð "×5Ñ5°lÓCˆIØ&/ˆD×Ñ˜UÑ#Ø2;œ˜UÓ.Ó/ñ) &=ñ. GVÓVÂo¸U˜T×-Ñ-×1Ñ1°%Ó8Ò8Áoˆ
ÐVØ× Ñ Ð!7Ô8ð "ŸZ™Z×<Ñ<Ó>Ñˆ�7äñ à"&×"2Ñ"2×"9Ñ"9Ô";óó ÷ ð ð 	!ô$ �t—}‘}¤e×,Ñ,Ø�~�~Þ'ÞÞÞØ�}�}Ø��ˆåFàŸ*™*›,ˆKØ#'ˆKÔ Ù(¨¯©°[ÓAˆKØ,1ˆKÔ)Ø).ˆKÔ&Ø×+Ñ+¨D×,BÑ,BÔCð ×&Ñ&¨UÐ&Ñ3Ø×'×'Ð'ð ×+×+Ö0HàŸ
™
×(Ñ(×+Ñ+×3Ñ3°K×4QÑ4QÓ4SÓTð,�KÔ(ð ,1�Ô(Þô
 '*£e�OÜ! $§-¡-´×7Ñ7Ø$(§M¤M˜DØ+¨t¯}©}«Ñ>šOñ %2à%/×%6Ñ%6Ö%8˜	Ø'¨9×+=Ñ+=Ó+?Ñ?šñ &9ð 9=×8NÑ8N×8TÑ8TÖ8VÑ4Ð(¨*Ø%×7Ñ7×9Ó9Ø+×/Ñ/Ð0@ÖAñ 9Wð  ×3Ñ3°OÔDð ˆHØ$.×$4Ñ$4Ö$6Ñ �Ø!�ØŸ>™>¨9¨+ÀE˜>ÓJ�CØ'/§|¡|°CÓ'8Ð8˜GÕ8Ü # H£°Ñ 1˜Ø&+¨E¨7 O˜	Ü"% i°Ó"5˜Ø(/˜ ™Ø=@˜×/Ñ/°	Ñ:Ø#×:Ñ:¸I¸;ÔGØ(/�L Ó%ñ Kð 2;×1NÑ1NØ ó2�×'Ñ'¨Ó.ñ %7ð ×"Ñ" bÓ(Ø#×0×0Ø#×:×:ð —J‘J×$Ñ$×'Ñ'×/Ñ/°×0MÑ0MÓ0OÓPð&�Ô"øð ˆKØˆDŒKØ %ˆDÔØˆDŒJØ××ð .2×-=Ñ-=×-CÑ-CÔ-Eô â-EÑ)˜˜zô ˜˜zÓ*¨JÒ6Ù-Eð ñ  ð -7×,<Ñ,<Ô,>ô$â,>Ñ(˜ð ×8Ñ8¸ÓFÒFÙ,>ò$�Õ ð
 $.�Ô Ø×$Ñ$ ZÔ0ð *×;Ñ;×BÑBÔDó
âD�
ð ×-Ô-ÙDð 	ð 
ô ÑVÑEUÓVÓVÔVˆØ×"Ñ"¨Ð"Ñ.Ø× Ñ Ô"Ø(-ˆÔ%Ø%*ˆÔ"Ø×+Ñ+¨E¸{Ð+ÐKˆØ×%Ñ%¤fÓ-ˆØ‰>Ø%‰Fà!×0Ñ0°×1NÑ1N×1UÑ1UÓ1WÓXˆJÜ˜(×3Ñ3°V°I¸zÓJÓKˆFä”C˜×5Ñ5°vÓ>Ó?Ð?ùò] Wùób ùó$ùò
s   Ä%ZÔ'Z"ÕZ(Ö2Z.c                 ób   • U R                  5       nUR                  US[        S5      05      S   $ )z?
Perform a COUNT() query using the current filter constraints.
Ú__countÚ*)r`   rA  r   )r\   rV   rá   s      r;   Ú	get_countÚQuery.get_count3  s0   € ð �j‰j‹lˆØ×"Ñ" 5¨9´e¸C³jÐ*AÓBÀ9ÑMÐMrC   c                 ó   • U R                   $ r4   )r«   r|   s    r;   Úhas_filtersÚQuery.has_filters:  s   € Ø�z‰zÐrC   c                 ó8  • U R                  5       nUR                  (       a  UR                  (       de  UR                  SL aF  UR	                  S U R
                  R                  R                   5       S5        UR                  SS9  UR                  5         UR                  (       a1  UR                  S:X  a!  [        S UR                   5       5      Ul
        UR                  SS9  U(       a  UR                  SS	9  UR                  [!        S5      S
5        U$ )NTc              3   ó8   #   • U  H  oR                   v •  M     g 7fr4   ©r7   r8   s     r;   r<   ÚQuery.exists.<locals>.<genexpr>B  s   é € ÐIÒ(H 1—Y–YÒ(Hùó   ‚F©Úallow_aliasesÚunionc              3   ó@   #   • U  H  nUR                  S S9v •  M     g7f)F)ÚlimitN)Úexists)r9   Úcombined_querys     r;   r<   rN  I  s%   é € ð 'â&8�Nð ×%Ñ%¨EÐ%Õ2Ú&8ùs   ‚r  r±   )ÚhighÚa)r`   r  r  r  Ú
add_fieldsr¤   rÒ   Úconcrete_fieldsÚset_group_byÚclear_select_clauserÚ   r  r�   r  Ú
set_limitsÚadd_annotationr   )r\   rT  rH   s      r;   rU  ÚQuery.exists=  sÙ   € Ø�J‰J‹LˆØ—
—
˜qŸ{Ÿ{Ø�z‰z˜TÒ!Ø—‘ÙI¨¯
©
×(8Ñ(8×(HÒ(HÓIÈ5ôð
 —‘¨U�Ñ3Ø×!Ñ!Ô#Ø×× !§,¡,°'Ó"9Ü!&ñ 'à&'×&8Ò&8ó'ó "ˆAÔð 	
×Ñ˜tÐÑ$ÞØ�L‰L˜aˆLÑ Ø	×Ñœ˜q› 3Ô'ØˆrC   c                 ób   • U R                  U5      nUR                  US9nUR                  5       $ )N©rV   )rU  rÄ   Úhas_results)r\   rV   rH   rÎ   s       r;   rb  ÚQuery.has_resultsS  s/   € Ø�K‰K˜ÓˆØ—>‘>¨�>Ð.ˆØ×#Ñ#Ó%Ð%rC   c                 ó  • U R                  5       nU H3  n[        R                  U5      (       a  SU;   d  M%  [        SU< S35      e   [	        X#5      Ul        UR                  US9nSR                  UR                  5       5      $ )Nz--zInvalid option name: Ú.ra  Ú
)	r`   ÚEXPLAIN_OPTIONS_PATTERNÚ	fullmatchrÍ   r›   Úexplain_inforÄ   ÚjoinÚexplain_query)r\   rV   rœ   r�   rH   Úoption_namerÎ   s          r;   ÚexplainÚQuery.explainX  s{   € Ø�J‰J‹LˆÛ"ˆKä+×5Ñ5°k×BÑBØ˜;Õ&ä Ð#8¸¹ÀqÐ!IÓJÐJñ #ô % VÓ5ˆŒØ—>‘>¨�>Ð.ˆØ�y‰y˜×/Ñ/Ó1Ó2Ð2rC   c                 óÌ  ^ • T R                   UR                   :w  a  [        S5      eT R                  (       a  [        S5      eT R                  UR                  :w  a  [        S5      eT R                  UR                  :w  a  [        S5      eT R                  5       nUR                  T U1S9  0 nU[        :H  nU(       a
  [        5       O[        T R                  5      n[        USS5      nUR                  U 4S jT R                   5       5        [        5       n[        UR                  5      S	S
 n	U	 H˜  n
UR                  U
   nUR                  U5      nT R                  X¶S9nUR                  [         :X  a  UR#                  U5        UR%                  U5        X¬:w  a  XÄU
'   UR&                  U
   (       a  M‡  T R)                  U5        Mš     UR                  U5        UR+                  T 5        T =R,                  UR,                  -  sl        UR.                  R1                  5       nUR3                  U5        T R.                  R#                  XÒ5        UR4                  (       a;  T R7                  UR4                   Vs/ s H  oîR                  U5      PM     sn5        OST l        U[8        :X  a-  T R:                  (       a  UR:                  (       a  [=        S5      eT R:                  R?                  UR:                  5        [        5       nT R@                  b  UR?                  T R@                  5        UR@                  b  UR?                  UR@                  5        U(       a  T RC                  U5        T =RD                  URD                  -  sl"        URF                  =(       d    T RF                  T l#        URH                  =(       d    T RH                  T l$        g
s  snf )a  
Merge the 'rhs' query into the current one (with any 'rhs' effects
being applied *after* (that is, "to the right of") anything in the
current query. 'rhs' is not modified during a call to this function.

The 'connector' parameter describes how to connect filters from the
'rhs' query.
z4Cannot combine queries on two different base models.z3Cannot combine queries once a slice has been taken.z6Cannot combine a unique query with a non-unique query.z6Cannot combine queries with different distinct fields.)Úexcludeé   Fc              3   ón   >#   • U  H*  nTR                   U   R                  [        :X  d  M&  Uv •  M,     g 7fr4   )r¦   Ú	join_typer    )r9   Újr\   s     €r;   r<   Ú Query.combine.<locals>.<genexpr>‘  s,   øé € ð 
Ú%�!¨¯©¸Ñ):×)DÑ)DÌÑ)M�A‰A’~ùs   ƒ%5¬	5r±   N)rö   r‰   zSWhen merging querysets using 'or', you cannot have extra(select=...) on both sides.)%r¤   r  r  r  Údistinct_fieldsr  Úbump_prefixr(   r>   r¦   ÚJoinPromoterÚ	add_votesrr   rí   rj  rs  r    r   Údiscardr¥   Úunref_aliasÚupdate_join_typesrÖ   r«   r`   Úrelabel_aliasesr´   Ú
set_selectr)   r­   rÍ   ÚupdaterÜ   Úset_extra_maskÚextra_tablesÚorder_byÚextra_order_by)r\   ÚrhsÚ	connectorÚinitial_aliasrì   Úconjunctionrö   ÚjoinpromoterÚ	rhs_votesÚ
rhs_tablesr½   rj  Ú	new_aliasÚwr:  rÜ   s   `               r;   ÚcombineÚQuery.combined  s  ø€ ð �:‰:˜Ÿ™Ó"ÜÐRÓSÐSØ�>�>ÜÐQÓRÐRØ�=‰=˜CŸL™LÓ(ÜÐTÓUÐUØ×Ñ 3×#6Ñ#6Ó6ÜÐTÓUÐUð ×.Ñ.Ó0ˆØ�‰˜ } oˆÑ6ð ˆ
Ø¤3Ñ&ˆö %””¬#¨d¯n©nÓ*=ˆÜ# I¨q°%Ó8ˆØ×Ñô 
Ø—~’~ó
ô 	
ô “Eˆ	ô ˜#Ÿ-™-Ó(¨¨Ð,ˆ
ÛˆEØ—=‘= Ñ'ˆDð ×'Ñ'¨
Ó3ˆDØŸ	™	 $˜	Ð4ˆIØ�~‰~¤Ó&Ø—‘˜iÔ(ð �M‰M˜)Ô$ØÓ!Ø$-˜5Ñ!Ø×%Ñ% e×,Ñ,ð
 × Ñ  Ö+ñ'  ð( 	×Ñ˜yÔ)Ø×&Ñ& tÔ,ð 	×Ò˜S×-Ñ-Ñ-Õð �I‰I�O‰OÓˆØ	×Ñ˜*Ô%Ø�
‰
�‰�qÔ$ð �:�:Ø�O‰OÈÏ
Ê
ÓSÊ
À×0Ñ0°Ö<É
ÑSÕTàˆDŒKàœ‹?ð �z�z˜cŸiŸiÜ ð7óð ð 	�
‰
×Ñ˜#Ÿ)™)Ô$Ü›EÐØ×!Ñ!Ñ-Ø×$Ñ$ T×%;Ñ%;Ô<Ø× Ñ Ñ,Ø×$Ñ$ S×%:Ñ%:Ô;ÞØ×ÑÐ 1Ô2Ø×Ò˜S×-Ñ-Ñ-Õð Ÿ™×5¨¯©ˆŒØ!×0Ñ0×G°D×4GÑ4GˆÕùò5 Ts   ÊO!c                 óü  • Uc  0 n0 X1R                   '   UR                   Hä  nUR                  UR                  S 5      nUR                  UR                  S 5      nUc  Uc  UR                  U0 5        MU  U(       d  M^  UR                  (       d  [        [        [        U5      5      5      eUR                  U0 5      nUR                  R                  R                  R                  nU R                  UR                  XW5        Mæ     UR                  5        Hà  u  p•U R                   R#                  U	5      =n
(       a;  UR%                  U
R&                  5      nUR                  X›40 5      nUR(                  nOBUR%                  U	5      n[+        US5      (       d  M†  UR(                  nUR                  U0 5      nUR                  R                  R                  nU R                  UR                  XW5        Mâ     U$ )Nr¶   )r  rZ  rà   r6   r7   Ú
setdefaultÚis_relationr   r·   rs   Úremote_fieldr¤   rÒ   Úconcrete_modelÚ_get_defer_select_maskr�   r®   r"  Ú	get_fieldÚrelation_namer¶   rç   )r\   rA   ÚmaskÚselect_maskr¶   Ú
field_maskÚfield_att_maskÚfield_select_maskÚrelated_modelÚ
field_nameÚfiltered_relationÚrelationÚreverse_rels                r;   r”  ÚQuery._get_defer_select_mask×  sµ  € ØÑØˆKØ!ˆ—G‘GÑð
 ×)Ô)ˆEØŸ™ %§*¡*¨dÓ3ˆJØ!ŸX™X e§m¡m°TÓ:ˆNØÑ! nÑ&<Ø×&Ñ& u¨bÖ1ß�Ø×(×(Ü$¤T¬$¨zÓ*:Ó%;Ó<Ð<Ø$/×$:Ñ$:¸5À"Ó$EÐ!Ø %× 2Ñ 2× 8Ñ 8× >Ñ >× MÑ M�Ø×+Ñ+Ø!×'Ñ'¨öñ *ð  '+§j¡j¦lÑ"ˆJØ$(×$<Ñ$<×$@Ñ$@ÀÓ$LÐLÐ ÕLØŸ>™>Ð*;×*IÑ*IÓJ�Ø$/×$:Ñ$:¸JÐ;QÐSUÓ$VÐ!Ø Ÿ™‘à"Ÿn™n¨ZÓ8�ô ˜{¨G×4Ñ4ÙØ#×)Ñ)�Ø$/×$:Ñ$:¸5À"Ó$EÐ!Ø!ŸK™K×-Ñ-×<Ñ<ˆMØ×'Ñ'Ø×#Ñ# Zöñ# '3ð( ÐrC   c                 óÚ  • Uc  0 n0 X1R                   '   UR                  5        HÃ  u  pEUR                  U5      nXaR                  ;   a  UR                  nOUnUR                  U0 5      nU(       d  MO  UR                  (       d  [        [        [        U5      5      5      eUR                  R                  R                  R                  n	U R                  U	R                  XX5        MÅ     U$ r4   )r  r�   r•  Úrelated_objectsr¶   r�  r‘  r   r·   rs   r’  r¤   rÒ   r“  Ú_get_only_select_mask)
r\   rA   r—  r˜  r�  r™  r¶   Ú	field_keyr›  rœ  s
             r;   r¤  ÚQuery._get_only_select_mask  sÊ   € ØÑØˆKØ!ˆ—G‘GÑà&*§j¡j¦lÑ"ˆJØ—N‘N :Ó.ˆEð ×,Ñ,Ó,Ø!ŸK™K‘	à!�	Ø +× 6Ñ 6°yÀ"Ó EÐßˆzØ×(×(Ü$¤T¬$¨zÓ*:Ó%;Ó<Ð<Ø %× 2Ñ 2× 8Ñ 8× >Ñ >× MÑ M�Ø×*Ñ*Ø!×'Ñ'¨öñ '3ð  ÐrC   c                 ó  • U R                   u  pU(       d  0 $ 0 nU H3  nUnUR                  [        5       H  nUR                  U0 5      nM     M5     U R	                  5       nU(       a  U R                  Xs5      $ U R                  Xs5      $ )a˜  
Convert the self.deferred_loading data structure to an alternate data
structure, describing the field that *will* be loaded. This is used to
compute the columns to select from the database and also by the
QuerySet class to work out which fields are being initialized on each
model. Models that have all their fields included aren't mentioned in
the result, only those that have field restrictions in place.
)Údeferred_loadingÚsplitr   r�  rÓ   r”  r¤  )r\   Úfield_namesÚdeferr—  r�  Ú	part_maskÚpartrA   s           r;   Úget_select_maskÚQuery.get_select_mask  s‡   € ð "×2Ñ2ÑˆÞØˆIØˆÛ%ˆJØˆIØ"×(Ñ(¬Ö4�Ø%×0Ñ0°°rÓ:’	ó 5ñ &ð �}‰}‹ˆÞØ×.Ñ.¨tÓ:Ð:Ø×)Ñ)¨$Ó5Ð5rC   c                 ó|  • U R                   R                  U5      nU(       d'  U(       a   US   nU R                  U==   S-  ss'   US4$ U(       a9  SU R                  [	        U R
                  5      S-   4-  nUR                  U5        O!Ub  UR                  OUnU/U R                   U'   SU R                  U'   US4$ )zà
Return a table alias for the given table_name and whether this is a
new alias or not.

If 'create' is true, a new alias is always created. Otherwise, the
most recently created alias for the table (if one exists) is reused.
r   r±   Fú%s%dT)r©   r"  r¥   Úalias_prefixr³   r¦   Úappendr½   )r\   Ú
table_nameÚcreaterž  Ú
alias_listr½   s         r;   Útable_aliasÚQuery.table_alias2  sÀ   € ð —^‘^×'Ñ'¨
Ó3ˆ
Þž*Ø˜q‘MˆEØ×Ñ Ó&¨!Ñ+Ó&Ø˜%�<Ðö Ø˜d×/Ñ/´°T·^±^Ó1DÀqÑ1HÐIÑIˆEØ×Ñ˜eÕ$ð ,=Ñ+HÐ!×'Ò'Èjð ð +0¨ˆD�N‰N˜:Ñ&Ø%&ˆ×Ñ˜EÑ"Ø�dˆ{ÐrC   c                 ó2   • U R                   U==   S-  ss'   g)z-Increases the reference count for this alias.r±   N©r¥   r¼   s     r;   Ú	ref_aliasÚQuery.ref_aliasM  s   € à×Ñ˜EÓ" aÑ'Ô"rC   c                 ó2   • U R                   U==   U-  ss'   g)z-Decreases the reference count for this alias.Nrº  )r\   r½   Úamounts      r;   r{  ÚQuery.unref_aliasQ  s   € à×Ñ˜EÓ" fÑ,Ô"rC   c                 ó–  ^ ^^• [        T5      mT(       Ga3  TR                  S5      mT R                  T   R                  c  M5  T R                  T   R                  c   eT R                  T   R                  nU=(       a     T R                  U   R                  [
        :H  nT R                  T   R                  [
        :H  nT R                  T   R                  (       d  U(       aX  U(       dQ  T R                  T   R                  5       T R                  T'   TR                  UUU 4S jT R                   5       5        T(       a  GM2  gg)aà  
Promote recursively the join type of given aliases and its children to
an outer join. If 'unconditional' is False, only promote the join if
it is nullable or the parent join is an outer join.

The children promotion is done to avoid join chains that contain a LOUTER
b INNER c. So, if we have currently a INNER b INNER c and a->b is promoted,
then we must also promote b->c automatically, or otherwise the promotion
of a->b doesn't actually change anything in the query results.
r   Nc              3   óv   >#   • U  H.  nTR                   U   R                  T:X  d  M"  UT;  d  M*  Uv •  M0     g 7fr4   )r¦   Úparent_alias)r9   rj  r½   Úaliasesr\   s     €€€r;   r<   Ú&Query.promote_joins.<locals>.<genexpr>s  s@   øé € ð â .˜Ø—~‘~ dÑ+×8Ñ8¸EÑAó ð  GÑ+÷ ‘DÚ .ùs   ƒ!9¨9°	9)	rr   rà   r¦   rs  rÂ  r!   ÚnullableÚpromoteÚextend)r\   rÃ  rÂ  Úparent_louterÚalready_louterr½   s   ``   @r;   Úpromote_joinsÚQuery.promote_joinsU  sÿ   ú€ ô �w“-ˆßØ—K‘K “NˆEØ�~‰~˜eÑ$×.Ñ.Ñ6ñ à—>‘> %Ñ(×2Ñ2Ñ>Ð>Ð>ØŸ>™>¨%Ñ0×=Ñ=ˆLà×Q §¡°Ñ!=×!GÑ!GÌ6Ñ!Qð ð "Ÿ^™^¨EÑ2×<Ñ<ÄÑFˆNØ—‘˜uÑ%×.×.¶-ÎØ(,¯©°uÑ(=×(EÑ(EÓ(G�—‘˜uÑ%ð —‘ö à $§¢óô ÷% ‹grC   c                 óŠ  • [        U5      nU(       a±  UR                  S5      nU R                  U   R                  [        :X  au  U R                  U   R                  5       U R                  U'   U R                  U   R                  nU R                  U   R                  [        :X  a  UR                  U5        U(       a  M°  gg)a�  
Change join type from LOUTER to INNER for all joins in aliases.

Similarly to promote_joins(), this method must ensure no join chains
containing first an outer, then an inner join are generated. If we
are demoting b->c join in chain a LOUTER b LOUTER c then we must
demote a->b automatically, or otherwise the demotion of b->c doesn't
actually change anything in the query results. .
r   N)	rr   rà   r¦   rs  r!   ÚdemoterÂ  r    r³  )r\   rÃ  r½   rÂ  s       r;   Údemote_joinsÚQuery.demote_joinsz  s’   € ô �w“-ˆÞØ—K‘K “NˆEØ�~‰~˜eÑ$×.Ñ.´&Ó8Ø(,¯©°uÑ(=×(DÑ(DÓ(F�—‘˜uÑ%Ø#Ÿ~™~¨eÑ4×AÑA�Ø—>‘> ,Ñ/×9Ñ9¼UÓBØ—N‘N <Ô0÷ ŠgrC   c                 ó°   • U R                   R                  5       R                  5        H*  u  p#X1R                  US5      -
  nU R	                  X$5        M,     g)zX
Reset reference counts for aliases so that they match the value passed
in `to_counts`.
r   N)r¥   rØ   r�   r"  r{  )r\   Ú	to_countsr½   Úcur_refcountÚunref_amounts        r;   Úreset_refcountsÚQuery.reset_refcounts�  sK   € ð
 $(×#6Ñ#6×#;Ñ#;Ó#=×#CÑ#CÖ#EÑˆEØ'¯-©-¸¸qÓ*AÑAˆLØ×Ñ˜UÖ1ò $FrC   c                 óº  • [        U5      R                  UR                  5       5      (       d   eU R                  R	                  U5        [        U R                  [        5      (       a9  [        U R                   Vs/ s H  o"R                  U5      PM     sn5      U l        [        U R                   Vs/ s H  o"R                  U5      PM     sn5      U l	        U R                  =(       a>    U R                  R                  5        VVs0 s H  u  p2X2R                  U5      _M     snnU l
        UR                  5        H±  u  pEX@R                  ;  a  M  U R                  U   R                  U5      nX`R                  U'   U R                  U   U R                  U'   U R                  U	 U R                  U	 U R                  UR                     n[!        U5       H  u  p‰X”:X  d  M  XWU'     M¯     M³     U R"                  R                  5        V	V
s0 s H"  u  pšUR%                  X™5      U
=(       d    X‘;   _M$     sn
n	U l        gs  snf s  snf s  snnf s  sn
n	f )z’
Change the aliases in change_map (which maps old-alias -> new-alias),
relabelling any references to them in select columns and the where
clause.
N)r>   Ú
isdisjointr¸   r«   r}  rF   r  r�   rí   r´   r¬   r�   r¦   r¥   r©   r´  Ú	enumerater¨   r"  )r\   rì   r:  r“   Ú	old_aliasr‹  Ú
alias_dataÚtable_aliasesÚposr½   Úaliaseds              r;   rë   ÚQuery.change_aliases–  s  € ô �:‹×)Ñ)¨*×*;Ñ*;Ó*=×>Ñ>Ð>Ð>ð 	�
‰
×"Ñ" :Ô.Ü�d—m‘m¤U×+Ñ+Ü!Ø<@¿MºMÓJºM°S×$Ñ$ ZÖ0¹MÑJóˆDŒMô ÈÏÊÓTÊÀ×0Ñ0°Ö<ÉÑTÓUˆŒØ×+Ñ+÷ 
à ×,Ñ,×2Ñ2Ô4ô1
â4‘�ð ×$Ñ$ ZÓ0Ò0Ù4ò1
ˆÔð %/×$4Ñ$4Ö$6Ñ ˆIØ§¡Ó.ÙØŸ™¨	Ñ2×BÑBÀ:ÓNˆJØ(2�N‰N˜9Ñ%Ø-1×-@Ñ-@ÀÑ-KˆD×Ñ 	Ñ*Ø×#Ñ# IÐ.Ø—‘˜yÐ)à ŸN™N¨:×+@Ñ+@ÑAˆMÜ'¨Ö6‘
�ØÕ%Ø)2 #Ñ&Úó 7ñ %7ð" #'×"7Ñ"7×"=Ñ"=Ô"?ô!
ò #@‘�ð �N‰N˜5Ó(¨7×+I°eÑ6IÒIÙ"?ò!
ˆÕùò/ KùâTùó1
ùó(!
s   Á=IÂ6IÄIÈ)Ic           
      ó\  ^ • U 4S jnT R                   UR                   :w  a  g[        R                  " 5       S-  n[        U" 5       5       H.  u  pVUT R                  ;  a	  UT l           OXT:”  d  M%  [        S5      e   T R                  R                  T R                   /5      T l        UR                  R                  T R                  5      Ul        Uc  0 nT R                  [        T R                  5       VVs0 s H  u  pWXr;  d  M  UST R                   U4-  _M      snn5        gs  snnf )a  
Change the alias prefix to the next letter in the alphabet in a way
that the other query's aliases and this query's aliases will not
conflict. Even tables that previously had no alias will get an alias
after this call. To prevent changing aliases use the exclude parameter.
c               3   ó
  >#   • [         n [        [        TR                  5      S-   5      nUv •  [	        S5       HD  nU(       a  X R                  U5      S OU n[        X2S9 H  nSR                  U5      v •  M     SnMF     g7f)zÈ
Generate a sequence of characters in alphabetical order:
    -> 'A', 'B', 'C', ...

When the alphabet is finished, the sequence will continue with the
Cartesian product:
    -> 'AA', 'AB', 'AC', ...
r±   N)ÚrepeatÚ )r
   ÚchrÚordr²  r   r<  r	   rj  )ÚalphabetÚprefixÚnÚseqÚsr\   s        €r;   Ú
prefix_genÚ%Query.bump_prefix.<locals>.prefix_genË  st   øé € ô 'ˆHÜœ˜T×.Ñ.Ó/°!Ñ3Ó4ˆFØŠLÜ˜1–X�Þ<B�hŸ~™~¨fÓ5Ð7Ñ8È�Ü  Ô/�AØŸ'™' !›*Ô$ñ 0à’ò	 ùs   ƒB BNé   z6Maximum recursion depth exceeded: too many subqueries.r±  )	r²  ÚsysÚgetrecursionlimitrØ  rÖ   ÚRecursionErrorrR  rë   r¦   )r\   Úother_queryrp  rê  Úlocal_recursion_limitrÜ  ræ  r½   s   `       r;   rw  ÚQuery.bump_prefixÃ  s  ø€ õ	ð$ ×Ñ × 8Ñ 8Ó8àô !$× 5Ò 5Ó 7¸2Ñ =ÐÜ$¡Z£\Ö2‰KˆCØ˜T×.Ñ.Ó.Ø$*�Ô!ÙØÕ*Ü$ØLóð ñ 3ð !×-Ñ-×3Ñ3°T×5FÑ5FÐ4GÓHˆÔØ#.×#;Ñ#;×#AÑ#AÀ$×BSÑBSÓ#TˆÔ Ø‰?ØˆGØ×Ñô #,¨D¯N©NÔ";ôâ";‘J�CØÑ'ó 9��v ×!2Ñ!2°CÐ 8Ñ8Ò8Ù";òõ	
ùós   Ã:D(
Ä	D(
c                 ó  • U R                   (       a  U R                  nU R                  U5        U$ U R                  (       a;  U R	                  U R                  U R                  5       R                  S5      5      nU$ SnU$ )zN
Return the first alias for this query, after increasing its reference
count.
N)r¦   r¾   r»  r¤   rj  Úbase_table_classrÓ   Údb_tabler¼   s     r;   r  ÚQuery.get_initial_aliasú  sj   € ð
 �>�>Ø—O‘OˆEØ�N‰N˜5Ô!ð
 ˆð	 �Z�ZØ—I‘I˜d×3Ñ3°D·M±M³O×4LÑ4LÈdÓSÓTˆEð ˆð ˆEØˆrC   c                 ó„   • [        U R                  R                  5        Vs/ s H  o(       d  M  SPM     sn5      $ s  snf )z»
Return the number of tables in this query with a non-zero reference
count. After execution, the reference counts are zeroed, so tables
added in compiler will not be seen by this method.
r±   )r³   r¥   r¸   )r\   r   s     r;   Úcount_active_tablesÚQuery.count_active_tables  s4   € ô  4×#6Ñ#6×#=Ñ#=Ô#?ÓIÒ#?˜%Ã5—AÑ#?ÑIÓJÐJùÒIs   ¢
=°=c                 ó  • U(       aU  U(       aN  U R                   R                  5        VVs/ s H&  u  pEXB;   d  M  UR                  U5      (       d  M$  UPM(     nnnO?U R                   R                  5        VVs/ s H  u  pEUb  XB;   d  M  XQ:X  d  M  UPM     nnnU(       a5  UR                  U;   a  UR                  nOUS   nU R	                  U5        U$ U R                  UR
                  SUR                  S9u  p‰UR                  (       aO  U R                   UR                     R                  [        :X  d  UR                  (       a  [        n
O[        n
X¡l        X�l        XR                   U'   U$ s  snnf s  snnf )aD  
Return an alias for the 'join', either reusing an existing alias for
that join or creating a new one. 'join' is either a base_table_class or
join_class.

The 'reuse' parameter can be either None which means all joins are
reusable, or it can be a set containing the aliases that can be reused.

The 'reuse_with_filtered_relation' parameter is used when computing
FilteredRelation instances.

A join is always created as LOUTER if the lhs alias is LOUTER to make
sure chains like t1 LOUTER t2 INNER t3 aren't generated. All new
joins are created as LOUTER if the join is nullable.
éÿÿÿÿT)rµ  rž  )r¦   r�   Úequalsr·  r»  r´  rž  rs  rÂ  r!   rÅ  r    )r\   rj  rö   Úreuse_with_filtered_relationrX  rt  Úreuse_aliasesÚreuse_aliasr½   r0  rs  s              r;   rj  Ú
Query.join  sN  € ö  (®Eà"Ÿn™n×2Ñ2Ô4ôÚ4‘d�a¸¹
“ÀqÇxÁxÐPTÇ~—Ñ4ð ñ ˆMð !ŸN™N×0Ñ0Ô2ôâ2‘D�AØ‘M Q¡Zó à56±Y÷ Ù2ð ñ ö
 Ø×Ñ =Ó0Ø"×.Ñ.‘ð ,¨BÑ/�Ø�N‰N˜;Ô'ØÐð ×#Ñ#Ø�O‰O D¸D×<RÑ<Rð $ð 
‰ˆð �>�>Ø�~‰~˜d×/Ñ/Ñ0×:Ñ:¼fÓDÈÏÏÜ"‘	ä!�	Ø&ŒNØ ÔØ $�‰�uÑØˆùó?ùós"   ¬E5»E5ÁE5Á:E;ÂE;ÂE;c                 ó†  • X$;   a  XB   $ UR                  U5      nU(       d  U$ UnU H‰  nXt;   a  UR                  nXG   nM  UR                  U   (       d  UR                  nM<  UR                  U5      nU R	                  UR
                  /Xc5      n	UR                  nU	R                  S   =o4U'   M‹     U=(       d    US   $ )aM  
Make sure the given 'model' is joined in the query. If 'model' isn't
a parent of 'opts' or if it is None this method is a no-op.

The 'alias' is the root alias for starting the join, 'seen' is a dict
of model -> alias of existing joins. It must also contain a mapping
of None -> some alias. This will be returned in the no-op case.
rû  N)Úget_base_chainrÒ   ÚparentsÚget_ancestor_linkÚsetup_joinsr6   rM   )
r\   rA   r¤   r½   Úseenr   Ú	curr_optsÚ	int_modelÚ
link_fieldÚ	join_infos
             r;   Újoin_parent_modelÚQuery.join_parent_modelB  sÅ   € ð ‹=Ø‘;ÐØ×#Ñ# EÓ*ˆÞØˆLØˆ	ÛˆIØÓ Ø%ŸO™O�	Ø™�Ùð
 ×$Ñ$ Y×/Ø%ŸO™O�	ÙØ"×4Ñ4°YÓ?ˆJØ×(Ñ(¨*¯/©/Ð):¸IÓMˆIØ!Ÿ™ˆIØ&/§o¡o°bÑ&9Ð9ˆE˜“Oñ ð  ×"˜˜T™
Ð"rC   c                 óN   • [         R                  U5      (       a  [        S5      eg )NzbColumn aliases cannot contain whitespace characters, quotation marks, semicolons, or SQL comments.)ÚFORBIDDEN_ALIAS_PATTERNÚsearchrÍ   r¼   s     r;   r  ÚQuery.check_aliasc  s*   € Ü"×)Ñ)¨%×0Ñ0Üð/óð ð 1rC   c                 ó   • U R                  U5        UR                  U SSS9nU(       a  U R                  U/5        O4U R                  [	        U R
                  5      R                  U15      5        XR                  U'   g)z0Add a single annotation expression to the Query.TN)rõ   rö   )r  r  r  r  r>   r[   Ú
differencer¬   )r\   r  r½   r´   s       r;   r^  ÚQuery.add_annotationj  so   € à×Ñ˜ÔØ×2Ñ2°4ÀTÐQUÐ2ÐVˆ
ÞØ×'Ñ'¨¨Õ0à×$Ñ$¤S¨×)?Ñ)?Ó%@×%KÑ%KÈUÈGÓ%TÔUØ",×Ñ˜ÒrC   c           
      ó�  • U R                  5       nUR                  U5        SUl        UR                  R                  " U/UQ70 UD6  UR
                  (       a?  [        UR                   Vs/ s H  nUR                  " U/UQ70 UD6PM     sn5      Ul        UR                  R                  5        H_  u  pgUR                  " U/UQ70 UD6n[        US5      (       a%  UR                  R                  UR                  5        X„R                  U'   Ma     UR                  R                  5        H�  u  pš[        U
[        5      =(       a-    U
R                   R"                  R$                  R&                  U	:g  =(       d0    [        U
[(        5      =(       a    U
R*                  U
R,                  :g  UR                  U	'   M�     U$ s  snf )NTr¨   )r`   rw  r  r«   r  r  r�   rÚ   r¬   r�   rç   r¨   r  r¦   rF   r&   Ú
join_fieldrœ  rÒ   rõ  r$   r´  r·  )r\   râ   ÚargsÚkwargsr`   rV  r“   ÚvalueÚresolvedr½   Útables              r;   r  ÚQuery.resolve_expressiont  s‡  € Ø—
‘
“ˆà×Ñ˜%Ô ØˆŒØ�‰×&Ò& uÐ>¨tÒ>°vÒ>à××Ü%*ð +0×*@Ò*@óâ*@˜ð #×5Ò5°eÐM¸dÒMÀfÔMÙ*@ñó&ˆEÔ"ð  ×+Ñ+×1Ñ1Ö3‰JˆCØ×/Ò/°ÐG¸ÒGÀÑGˆHÜ�xÐ!3×4Ñ4Ø×)Ñ)×0Ñ0°×1GÑ1GÔHØ%-×Ñ˜cÓ"ñ	 4ð "ŸO™O×1Ñ1Ö3‰LˆEä˜5¤$Ó'÷ KØ×$Ñ$×2Ñ2×8Ñ8×AÑAÀUÑJ÷-ô ˜5¤)Ó,×V°×1AÑ1AÀU×EVÑEVÑ1Vð	 ×"Ñ" 5Ó)ñ 4ð ˆùò%s   Á- Gc                 óö   • [        U R                  R                  5       U R                  R                  5      nU R                  USS9 Vs/ s H!  nUR                  U R                  ;   d  M  UPM#     sn$ s  snf )NT)Úinclude_external)r   r¬   r¸   r«   rE   r!  r½   r¨   )r\   Úexprsr:  s      r;   Úget_external_colsÚQuery.get_external_cols‘  sm   € Ü�d×&Ñ&×-Ñ-Ó/°·±×1DÑ1DÓEˆð —~‘~ e¸d�~ÑCó
âC�Ø�y‰y˜D×1Ñ1Ñ1÷ ÙCñ
ð 	
ùò 
s   ÁA6Á-A6c                 ól   • U R                  5       n[        S U 5       5      (       a  U=(       d    U /$ U$ )Nc              3   ó8   #   • U  H  oR                   v •  M     g 7fr4   )Úpossibly_multivalued)r9   r:  s     r;   r<   Ú*Query.get_group_by_cols.<locals>.<genexpr>Ÿ  s   é € ÐA²=¨C×'Ö'²=ùrO  )r  r  )r\   ÚwrapperÚexternal_colss      r;   r  ÚQuery.get_group_by_cols™  s6   € ð
 ×.Ñ.Ó0ˆÜÑA±=ÓA×AÑAØ—O˜tÐ$Ð$ØÐrC   c                 ó,  • U R                   (       aL  UR                  R                  (       d1  U R                  SS9  U R                   H  nUR                  SS9  M     U R                  US9R                  5       u  pEU R                   (       a  SU-  nXE4$ )NFr  )r’   z(%s))r  rp   Ú*ignores_unnecessary_order_by_in_subqueriesr  rÚ   rÄ   rÅ   )r\   rÎ   r’   râ   rU   rT   s         r;   rÅ   ÚQuery.as_sql£  s‚   € ð �M�MØ×'Ñ'×R×Rà×Ñ eÐÑ,Ø×.Ô.�Ø×$Ñ$¨5Ð$Ó1ñ /à×'Ñ'°:Ð'Ð>×EÑEÓG‰ˆØ�=�=Ø˜3‘,ˆCØˆ{ÐrC   c                 óø   ^ ^^• [        US5      (       a  UR                  T TTS9nU$ [        U[        [        45      (       a7  UUU 4S jU 5       n[        U5      n[        US5      (       a  U" U6 $ U" U5      $ U$ )Nr  )rö   rõ   c              3   óJ   >#   • U  H  nTR                  UTT5      v •  M     g 7fr4   )Úresolve_lookup_value)r9   Ú	sub_valuerõ   Ú	can_reuser\   s     €€€r;   r<   Ú-Query.resolve_lookup_value.<locals>.<genexpr>¼  s*   øé € ð â!&�Ið ×)Ñ)¨)°YÀ×LÐLÚ!&ùs   ƒ #Ú_make)rç   r  rF   rr   r�   Útype)r\   r  r/  rõ   r¸   Útype_s   ` ``  r;   r-  ÚQuery.resolve_lookup_value²  s‰   ú€ Ü�5Ð.×/Ñ/Ø×,Ñ,ØØØ'ð -ð ˆEð  ˆô ˜¤¤e˜}×-Ñ-öá!&óˆFô ˜“KˆEÜ�u˜g×&Ñ&Ù˜f�~Ð%Ù˜“=Ð ØˆrC   c                 óî  • UR                  [        5      nU R                  (       aD  [        X0R                  5      u  pEU(       a&  U R                  U   nU(       a  [	        XF5      nUSU4$ U R                  X0R                  5       5      u  pxpyUS[        U5      [        U	5      -
   n
[        U	5      S:”  a=  U
(       d6  [        SU< SU R                  5       R                  R                  < S35      eXšS4$ )zH
Solve the lookup type from the lookup (e.g.: 'foobar__id__icontains').
r‰   r   r±   zInvalid lookup "z" for model ú".F)r©  r   r¬   r   r   Únames_to_pathrÓ   r³   r   r¤   r{   )r\   Úlookupr÷   Úlookup_splittedr  Úexpression_lookupsr>  r0  r¶   Úlookup_partsÚfield_partss              r;   Úsolve_lookup_typeÚQuery.solve_lookup_typeÆ  sÛ   € ð !Ÿ,™,¤zÓ2ˆØ××Ü-<Ø×!1Ñ!1ó.Ñ*ˆJö Ø!×-Ñ-¨jÑ9�
ÞÜ!$ ZÓ!<�JØ)¨2¨zÐ9Ð9Ø$(×$6Ñ$6°ÏÉËÓ$XÑ!ˆ�!Ø% a¬#¨oÓ*>ÄÀ\ÓARÑ*RÐSˆÜˆ|Ó˜qÓ ®Ýã˜4Ÿ=™=›?×0Ñ0×9Ô9ð;óð ð ¨%Ð/Ð/rC   c                 ó®   • [        US5      (       aD  [        UR                  R                  X#5      (       d  [	        SU< SUR
                  < S35      egg)z€
Check whether the object passed while querying is of the correct type.
If not, raise a ValueError specifying the wrong object.
rÒ   zCannot query "z": Must be "z" instance.N)rç   r   rÒ   r¤   rÍ   Úobject_name)r\   r  rA   r¶   s       r;   Úcheck_query_object_typeÚQuery.check_query_object_typeÝ  sP   € ô
 �5˜'×"Ñ"Ü1°%·+±+×2CÑ2CÀT×QÑQÝ ã˜d×.Ô.ð0óð ð Rð #rC   c                 óÄ  • UR                   (       aÏ  [        U[        5      (       ah  UR                  (       dW  [	        UR
                  X15      (       d<  [        SUR
                  R                  R                  < SUR                  < S35      e[        US5      (       a  U R                  X#U5        g[        US5      (       a  U H  nU R                  XCU5        M     ggg)z3Check the type of object passed to query relations.zCannot use QuerySet for "z": Use a QuerySet for "r6  rÒ   ru   N)r‘  rF   r0   Úhas_select_fieldsr   r¤   rÍ   rÒ   r@  rç   rA  )r\   r¶   r  rA   Úvs        r;   Úcheck_related_objectsÚQuery.check_related_objectsé  s²   € à××ô ˜5¤%×(Ñ(Ø×/×/Ü6°u·{±{ÀD×PÑPå à—{‘{×(Ñ(×4Ô4°d×6FÔ6FðHóð ô ˜ ×(Ñ(Ø×,Ñ,¨U¸%Õ@Ü˜ 
×+Ñ+Û�AØ×0Ñ0°¸%Ö@ò ð ,ð# rC   c                 ó  • [        US5      (       a4  [        USS5      (       d"  [        UR                  R                  S-   5      e[        US5      (       a)  UR                  5        H  nU R                  U5        M     gg)z>Raise an error if expression cannot be used in a WHERE clause.r  Ú
filterableTz$ is disallowed in the filter clause.Úget_source_expressionsN)rç   rµ   r   rz   r{   rJ  Úcheck_filterable)r\   r>  r7  s      r;   rK  ÚQuery.check_filterable   s�   € ä�:Ð3×4Ñ4¼WØ˜ d÷>
ñ >
ô $Ø×$Ñ$×-Ñ-ð 1ñ óð ô �:Ð7×8Ñ8Ø"×9Ñ9Ö;�Ø×%Ñ% dÖ+ò <ð 9rC   c                 ó$  • U=(       d    S/Gt pEU H  nU R                  X&5      nM     UR                  U5      nU(       d,  U R                  X%5      nSnUR                  U5      nU(       d  gU" X#5      nUR                  c:  UR                  (       d)  US;  a  [	        S5      eUR                  S5      " US5      $ US:X  aN  UR                  S:X  a>  [
        [           R                  R                  (       a  UR                  S5      " US5      $ U$ )a  
Try to extract transforms and lookup from given lhs.

The lhs value is something that works like SQLExpression.
The rhs value is what the lookup is going to compare against.
The lookups is a list of names to extract using get_lookup()
and get_transform().
ÚexactN)rN  Úiexactz Cannot use None as a query valueÚisnullTrâ  )	Útry_transformÚ
get_lookupr„  Úcan_use_none_as_rhsrÍ   r   r   rp   Ú!interprets_empty_strings_as_nulls)	r\   ÚlookupsÚlhsr„  Ú
transformsÚlookup_namer6   Úlookup_classr8  s	            r;   Úbuild_lookupÚQuery.build_lookup  sú   € ð $+×#7¨w¨iÑ ˆÛˆDØ×$Ñ$ SÓ/ŠCñ ð —~‘~ kÓ2ˆÞð ×$Ñ$ SÓ6ˆCØ!ˆKØŸ>™>¨+Ó6ˆLÞØá˜cÓ'ˆð �:‰:Ñ f×&@×&@ØÐ"5Ó5Ü Ð!CÓDÐDØ—>‘> (Ô+¨C°Ó6Ð6ð ˜7Ó"Ø—
‘
˜bÓ ÜÔ,Ñ-×6Ñ6×X×Xà—>‘> (Ô+¨C°Ó6Ð6àˆrC   c                 óH  • UR                  U5      nU(       a  U" U5      $ UR                  R                  n[        R                  " X!R                  R                  5       5      nU(       a  SSR                  U5      -  nOSn[        SU< SUR                  < SU< 35      e)zh
Helper method for build_lookup(). Try to fetch and initialize
a transform for name parameter from lhs.
z, perhaps you meant %s?z or re  zUnsupported lookup 'z' for z# or join on the field not permitted)	Úget_transformr¹   rz   ÚdifflibÚget_close_matchesÚget_lookupsrj  r   r{   )r\   rV  r6   Útransform_classr¹   Úsuggested_lookupsÚ
suggestions          r;   rQ  ÚQuery.try_transform;  s”   € ð
 ×+Ñ+¨DÓ1ˆÞÙ" 3Ó'Ð'à×+Ñ+×5Ñ5ˆLÜ '× 9Ò 9Ø×&Ñ&×2Ñ2Ó4ó!Ðö !Ø6¸¿¹ÐEVÓ9WÑW‘
à �
Ýã!% |×'<Ô'<ºjðJóð rC   c
                 ó„
  • [        U[        5      (       a  [        S5      e[        U[        5      (       a  U R	                  UUUUUUUU	S9$ [        US5      (       ag  [        USS5      (       d  [        S5      eUR                  XU	S9n
[        U
[        5      (       d  U R                  S/U
S	5      n
[        U
/[        S
9/ 4$ Uu  p¼U(       d  [        SU-  5      eU R                  X¹5      u  pÞnU(       a  U R                  U5        U(       d  [        U5      S:”  a  [        S5      eU R                   R#                  5       nU R%                  XÄU5      nU R                   R'                  5        VVs1 s H   u  nnUUR)                  US5      :”  d  M  UiM"     nnnU(       a  U R                  U5        U(       a#  U R                  XßU5      n
[        U
/[        S
9/ 4$ U R+                  5       nU R-                  5       nU(       + =(       d    U(       + n U R/                  UUUUUUS9n[        U[0        5      (       a  [3        U5      nU R5                  UR6                  UUR8                  5        UR:                  U l        URE                  UR:                  5        U RG                  URH                  UR:                  URJ                  5      u  nnnUb  URE                  U5        UR6                  RL                  (       aS  [        U5      S:X  a!  U RO                  US   UR6                  U5      nOC[Q        UUURH                  UR6                  5      nO U RO                  US   UR6                  U5      nU R                  UUU5      n
U
RR                  n[        U
/[        S
9nUS:H  =(       a    U
RT                  S	L =(       a    U(       + nU(       Ga*  US:w  d  U
RT                  SL Ga  U
RT                  Gb  S	nUS:w  aþ  U RW                  US   5      (       d$  U RX                  US      RZ                  [\        :X  aT  US   R_                  S5      nU RO                  US   URH                  S   U5      nURa                  U" US5      [        5        [        U[b        5      (       aX  U RW                  URd                  5      (       a8  URd                  R_                  S5      nURa                  U" US5      [        5        UU(       d  U4$ S4$ s  snnf ! [>         a&  nU RA                  XURB                  5      s SnA$ SnAff = f)aø  
Build a WhereNode for a single filter clause but don't add it
to this Query. Query.add_q() will then add this filter to the where
Node.

The 'branch_negated' tells us if the current branch contains any
negations. This will be used to determine if subqueries are needed.

The 'current_negated' is used to determine if the current filter is
negated or not and this will be used to determine if IS NULL filtering
is needed.

The difference between current_negated and branch_negated is that
branch_negated is set on first negation, but current_negated is
flipped for each negation.

Note that add_filter will not do any negating itself, that is done
upper in the code by add_q().

The 'can_reuse' is a set of reusable joins for multijoins.

If 'reuse_with_filtered_relation' is True, then only joins in can_reuse
will be reused.

The method will create a filter clause that can be added to the current
query. However, if the filter isn't added to the query then the caller
is responsible for unreffing the joins used.
z"Cannot parse keyword query as dict)Úbranch_negatedÚcurrent_negatedrª   rõ   Ú
split_subqrK  r÷   r  ÚconditionalFz3Cannot filter against a non-conditional expression.)rõ   r÷   rN  T)r…  zCannot parse keyword query %rr±   ú7Joined field references are not permitted in this queryr   )r/  Ú
allow_manyrý  NrP  rû  r‰   )3rF   r€   r   r   Ú_add_qrç   rµ   r  r  r   rZ  r,   r(   r=  rK  r³   r¥   rØ   r-  r�   r"  rÓ   r  r  r   rr   rF  rK   rA   rM   Ú_lookup_joinsr'   Úsplit_excludeÚnames_with_pathr  Ú
trim_joinsrL   rN   r‘  rò   r   rX  r„  Úis_nullabler¦   rs  r!   rR  r   r   r²   ) r\   Úfilter_exprrf  rg  r/  rõ   rh  rý  rK  r÷   Ú	conditionÚargr  rU  ÚpartsÚreffed_expressionÚ	pre_joinsÚkrE  Ú
used_joinsrA   r½   rk  r
  ÚerL   Ú	join_listr:  Úlookup_typeÚclauseÚrequire_outerrY  s                                    r;   Úbuild_filterÚQuery.build_filterQ  sÈ  € ôP �k¤4×(Ñ(ÜÐAÓBÐBÜ�k¤1×%Ñ%Ø—;‘;ØØ-Ø /Ø&Ø'Ø%Ø!1Ø#ð ð 	ð 	ô �;Ð 4×5Ñ5Ü˜;¨°u×=Ñ=ÜÐ UÓVÐVØ#×6Ñ6Ø¸ð 7ð ˆIô ˜i¬×0Ñ0Ø ×-Ñ-¨w¨i¸ÀDÓI�	Ü˜i˜[´CÑ8¸"Ð<Ð<Ø ‰
ˆÞÜÐ<¸sÑBÓCÐCØ,0×,BÑ,BÀ3Ó,RÑ)ˆÐ)æØ×!Ñ!Ð"3Ô4æœs 5›z¨A›~ÜÐVÓWÐWà×'Ñ'×,Ñ,Ó.ˆ	Ø×)Ñ)¨%¸KÓHˆà×-Ñ-×3Ñ3Ô5ô
Ú5‘$�!�Q¸¸Y¿]¹]È1ÈaÓ=PÑ9P�AÑ5ð 	ñ 
ö Ø×!Ñ! %Ô(æØ×)Ñ)¨'ÀeÓLˆIÜ˜i˜[´CÑ8¸"Ð<Ð<à�}‰}‹ˆØ×&Ñ&Ó(ˆØ'Ô'×9¨z¬>ˆ
ð	QØ×(Ñ(ØØØØ#Ø%Ø-Ið )ð ˆIô ˜%¤×*Ñ*Ü˜U›�Ø×&Ñ& y×'<Ñ'<¸eÀYÇ^Á^ÔTð "+§¡ˆDÔð 	×Ñ˜)Ÿ/™/Ô*Ø$(§O¡OØ×Ñ˜yŸ™°	·±ó%
Ñ!ˆ�˜	ð Ñ Ø×Ñ˜YÔ'à× Ñ ×,×,Ü�7‹|˜qÓ Ø—m‘m G¨A¡J°	×0EÑ0EÀuÓM‘ä$Ø˜7 I×$5Ñ$5°y×7LÑ7Ló‘ð —-‘- ¨¡
¨I×,AÑ,AÀ5ÓIˆCà×%Ñ% g¨s°EÓ:ˆ	Ø×+Ñ+ˆÜ˜I˜;´#Ñ6ˆð ˜8Ñ#×U¨	¯©¸Ð(=×UÀoÔBUð 	÷ Ø Ó(¨I¯M©M¸UÓ,BØ—‘Ò)à ˆMØ˜hÓ&ð ×$Ñ$ W¨Q¡Z×0Ñ0Ø—~‘~ i°¡mÑ4×>Ñ>Ä&ÓHà#*¨1¡:×#8Ñ#8¸Ó#B�LØŸ-™-¨°©
°I×4EÑ4EÀaÑ4HÈ%ÓP�CØ—J‘J™|¨C°Ó7¼Ô=ô ˜e¤S×)Ñ)¨d×.>Ñ.>¸u¿|¹|×.LÑ.LØ#(§<¡<×#:Ñ#:¸8Ó#D�LØ—J‘J™|¨E°5Ó9¼3Ô?Ø®�zÐ>Ð>¸BÐ>Ð>ùóu
øôB ó 	QØ×%Ñ% k¸a×>OÑ>OÓPÕPûð	Qús+   Å3T	ÆT	ÈA,T Ô
T?ÔT:Ô4T?Ô:T?c                 ó:   • U R                  [        X45      5        g r4   )Úadd_qr   )r\   Ú
filter_lhsÚ
filter_rhss      r;   Ú
add_filterÚQuery.add_filterø  s   € Ø�
‰
”1�jÐ-Ó.Õ/rC   c                 ó4  • U R                    Vs1 s H'  o R                   U   R                  [        :X  d  M%  UiM)     nnU R                  XR                  5      u  pEU(       a   U R
                  R                  U[        5        U R                  U5        gs  snf )zW
A preprocessor for the internal _add_q(). Responsible for doing final
join promotion.
N)	r¦   rs  r    rl  rª   r«   r   r(   rÎ  )r\   Úq_objectrX  Úexisting_innerr}  r0  s         r;   r‚  ÚQuery.add_qû  sx   € ð —~’~ó
Ú%�!¯©¸Ñ):×)DÑ)DÌÑ)M�A‘~ð 	ð 
ð —K‘K ×*;Ñ*;Ó<‰	ˆÞØ�J‰J�N‰N˜6¤3Ô'Ø×Ñ˜.Õ)ùò
s
   �$B·Bc                 ó(   • U R                  USS9S   $ )NF)rõ   r   )r  )r\   rr  s     r;   Úbuild_whereÚQuery.build_where  s   € Ø× Ñ  ¸%Ð Ð@ÀÑCÐCrC   c                 ó"   • [        5       U l        g r4   )r,   r«   r|   s    r;   Úclear_whereÚQuery.clear_where  s   € Ü“[ˆ�
rC   c	                 ó®  • UR                   n	XAR                  -  nU=(       d    UR                  n[        X‘R                  S9n
[        UR                   [	        UR
                  5      U5      nUR
                   HF  nU R                  UUUUUUUUS9u  pÞUR                  U5        U(       d  M5  U
R                  XÙ5        MH     UR                  U 5      nX®4$ )z%Add a Q-object to the current filter.©r…  Únegated)r/  rf  rg  rõ   rh  rK  r÷   )
r…  r“  r,   rx  r³   rE   r  ry  r   r|  )r\   rˆ  rª   rf  rg  rõ   rh  rK  r÷   r…  Útarget_clauserˆ  rI   Úchild_clauseÚneeded_inners                  r;   rl  ÚQuery._add_q  sß   € ð ×&Ñ&ˆ	Ø×+Ñ+Ñ+ˆØ'×;¨8×+;Ñ+;ˆÜ!¨I×?OÑ?OÑPˆÜ#Ø×Ñ¤ H×$5Ñ$5Ó 6¸ó
ˆð ×&Ô&ˆEØ)-×):Ñ):ØØ&Ø-Ø /Ø'Ø%Ø!1Ø#ð *;ð 	*Ñ&ˆLð ×"Ñ" <Ô0ßˆ|Ø×!Ñ! ,Ö:ñ 'ð $×5Ñ5°dÓ;ˆØÐ*Ð*rC   c                 óP  • UR                   nXAR                  -  nU=(       d    UR                  n[        XQR                  S9nUR                   HS  n[	        U[
        5      (       a  U R                  UUUUS9nOU R                  UUUUSSSS9u  p‰UR                  X…5        MU     U$ )z4Add a FilteredRelation object to the current filter.r’  )rö   rf  rg  TF)r/  rf  rg  rõ   rh  rý  )	r…  r“  r,   rE   rF   r/   Úbuild_filtered_relation_qr  r   )
r\   rˆ  rö   rf  rg  r…  r”  rI   r•  r0  s
             r;   r™  ÚQuery.build_filtered_relation_q8  sÁ   € ð ×&Ñ&ˆ	Ø×+Ñ+Ñ+ˆØ'×;¨8×+;Ñ+;ˆÜ!¨I×?OÑ?OÑPˆØ×&Ô&ˆEÜ˜%¤×&Ñ&Ø#×=Ñ=ØØØ#1Ø$3ð	  >ð  ‘ð #'×"3Ñ"3ØØ#Ø#1Ø$3Ø $Ø$Ø15ð #4ð #‘�ð ×Ñ˜lÖ6ñ% 'ð& ÐrC   c           	      ó2  • X!l         [        [        UR                  5      5      nU R	                  UR
                  5      u  pEnU(       a  [        SUR
                  -  5      e[        U5       H�  nU R	                  U5      u  p‰nU(       d  SOSn
U	S U
*  n[        U5       HX  u  pÍ[        U5      U:”  a(  X\   U:w  a  [        SUR
                  < SU< S35      eM<  [        SU< SUR
                  < S35      e   M‘     XR                  UR                   '   g )	NzAFilteredRelation's relation_name cannot contain lookups (got %r).rq  r±   zCFilteredRelation's condition doesn't support relations outside the z (got z).zaFilteredRelation's condition doesn't support nested relations deeper than the relation_name (got z for )r½   r€   rG   rs  r=  r–  rÍ   r   rØ  r³   r®   )r\   rž  r½   rU  Úrelation_lookup_partsÚrelation_field_partsr0  r8  r;  Úlookup_field_partsÚshiftÚlookup_field_pathÚidxÚlookup_field_parts                 r;   Úadd_filtered_relationÚQuery.add_filtered_relationU  s/  € Ø"'ÔÜÔ*Ð+<×+FÑ+FÓGÓHˆØ9=×9OÑ9OØ×+Ñ+ó:
Ñ6Ð°Qö !ÜðØ/×=Ñ=ñ>óð ô ˜G–nˆFØ26×2HÑ2HÈÓ2PÑ/ˆL¨aÞ)‘A¨qˆEØ 2°7°U°FÐ ;ÐÜ*3Ð4EÖ*FÑ&�ÜÐ+Ó,¨sÓ2Ø+Ñ0Ð4EÓEÝ(ð  1×>Ô>ÃðHóð ñ Fõ %ó #)Ð*;×*IÔ*IðKóð ó +Gñ	 %ð$ =N× Ñ Ð!2×!8Ñ!8Ò9rC   c           	      óB  • / / pe[        U5       GH‘  u  pxU/ 4n	US:X  a  UR                  R                  nSn
Sn Uc  [        eUR	                  U5      n
U
bR  U
R                  (       a  U
R                  (       d  [        SU-  5      e U
R                   R"                  R$                  nOeUS-  nUS:X  d  U(       aP  [)        / [+        U5      QU R
                  QU R                  Q5      n[        SU< SS	R-                  U5      < 35      e  GO—UbZ  XòR                   LaL  UR/                  U5      nU(       a4  UR                  U5        U	S   R                  U5        US   R0                  n[3        U
S
5      (       aî  U(       a  U
R5                  U5      nOU
R6                  nU(       d`  [        U5       HQ  u  nnUR8                  (       d  M  U	S   R                  USUS-    5        UR;                  U	5        [=        US-   U5      e   US   nUR                  U5        UR>                  nUR0                  nUR@                  nU	S   R                  U5        UR;                  U	5        GM[  U
nU
4nU(       a+  US-   [C        U5      :w  a  [        SXS-      < SU< S35      e  O   UWWUWS-   S 4$ ! [         aÐ    X€R
                  ;   a  U R
                  U   R                  n
 GN’X€R                  ;   a’  US:X  aŒ  U R                  U   n[        UR                  ;   aN  UR                  R                  [        5      nU R                  UUUU5      u  pÚ  nUR                  USS 5         GNUR	                  UR                  5      n
 GN6f = f! [&         a    Sn GN�f = f)a”  
Walk the list of names and turns them into PathInfo tuples. A single
name in 'names' can generate multiple PathInfos (m2m, for example).

'names' is the path of names to travel, 'opts' is the model Options we
start the name resolving from, 'allow_many' is as for setup_joins().
If fail_on_missing is set to True, then a name that can't be resolved
will generate a FieldError.

Return a list of PathInfo tuples. In addition return the final field
(the last used join field) and target (which is a field guaranteed to
contain the same value as the final field). Finally, return those names
that weren't found (which are likely transforms and the final lookup).
r  Nr   rû  z¬Field %r does not generate an automatic reverse relation and therefore cannot be used for reverse querying. If it is a GenericForeignKey, consider adding a GenericRelation.r±   zCannot resolve keyword 'z' into field. Choices are: ú, Ú
path_infosúCannot resolve keyword z into field. Join on 'z' not permitted.)"rØ  r  r6   r   r•  r[   r¹   r®   r   r–  r©  r7  rÇ  r‘  rœ  r   r¤   rÒ   r“  ÚAttributeErrorÚsortedrB   rj  Úget_path_to_parentÚto_optsrç   Úget_path_infor§  Úm2mr³  r'   r  Útarget_fieldsr³   )r\   ÚnamesrA   rk  Úfail_on_missingrN   ro  rÜ  r6   Úcur_names_with_pathr¶   rž  ru  Úfiltered_relation_pathr0  r¤   Ú	availableÚpath_to_parentÚ	pathinfosÚ	inner_posÚpÚlastrK   rL   s                           r;   r7  ÚQuery.names_to_patht  s¤  € ð !# BˆoÜ" 5×)‰IˆCØ#'¨ *ÐØ�t‹|Ø—w‘w—|‘|�àˆEØ $ÐðPØ‘<Ü+Ð+ØŸ™ tÓ,�ð" Ñ ð ×$×$¨U×-@×-@Ü$ð4ð 7;ñ;óð ð!Ø!ŸK™K×-Ñ-×<Ñ<‘Eð �q‘�Ø˜"“9¦Ü &ðÜ6°tÓ<ðà!×3Ñ3ðð "×5Ñ5ðó!�Iõ %ã-1°4·9±9¸YÕ3GðIóð ò ð Ñ E·±Ò$;Ø!%×!8Ñ!8¸Ó!?�Þ!Ø—K‘K Ô/Ø'¨Ñ*×1Ñ1°.ÔAØ)¨"Ñ-×5Ñ5�DÜ�u˜l×+Ñ+Þ$Ø %× 3Ñ 3Ð4EÓ F‘Ià %× 0Ñ 0�IÞ!Ü(1°)Ö(<™˜	 1ØŸ5Ÿ5™5Ø/°Ñ2×9Ñ9¸)ÀAÈ	ÐTUÉÐ:VÔWØ+×2Ñ2Ð3FÔGÜ"+¨C°!©G°_Ó"EÐEñ	 )=ð
 ! ‘}�Ø—‘˜IÔ&Ø"Ÿo™o�Ø—|‘|�Ø×,Ñ,�Ø# AÑ&×-Ñ-¨iÔ8Ø×&Ñ&Ð':×;ð $�Ø ˜(�Þ" s¨Q¡w´#°e³*Ó'<Ý$à-2¸±7¬^»TðCóð ñ ñC *ðD �[ '¨5°°q±°Ð+;Ð;Ð;øôo %ó PØ×1Ñ1Ó1Ø ×2Ñ2°4Ñ8×EÑE“EØ×5Ñ5Ó5¸#À»(Ø(,×(@Ñ(@ÀÑ(FÐ%Ü!Ð%6×%DÑ%DÓDØ 1× ?Ñ ?× EÑ EÄjÓ Q˜Ø>B×>PÑ>PØ!Ø Ø&Ø+ó	?Ñ;Ð.°q¸!ð Ÿ™Ð$:¸3¸BÐ$?×@à $§¡Ð/@×/NÑ/NÓ O˜úðPûô: &ó !ð !“Eð!ús0   ºJ1Â NÊ12NË&BNÍ,NÎ
NÎNÎNc                 óJ  ^ ^^• U/nU 4S jnSm[        [        U5      SS5       H!  n	 T R                  USU	 UUSS9u  n
mp¼XS n  O   W H'  nUUU 4S jn[        R
                  " UXøS	9nSUl        M)     W
 Hø  nUR                  (       a'  UR                  R                  5       nUR                  nOSnSnUR                  nUR                  (       a  T R                  UR                  5      nOSnT R                  UR                  UU[         UR                  UUS
9nUR"                  (       d  U(       a  UOSnT R%                  UUUS9nUR'                  U5        U(       d  Mî  USS Ul        Mú     [+        TWX'X¨5      $ ! [         a  nU	S:X  a  e Um SnAGMx  SnAff = f)aR  
Compute the necessary table joins for the passage through the fields
given in 'names'. 'opts' is the Options class for the current model
(which gives the table we are starting from), 'alias' is the alias for
the table to start the joining from.

The 'can_reuse' defines the reverse foreign key joins we can reuse. It
can be None in which case all joins are reusable or a set of aliases
that can be reused. Note that non-reverse foreign keys are always
reusable when using setup_joins().

The 'reuse_with_filtered_relation' can be used to force 'can_reuse'
parameter and force the relation on the given connections.

If 'allow_many' is False, then any reverse foreign key seen will
generate a MultiJoin exception.

Return the final field involved in the joins, the target field (used
for any 'where' constraint), the final 'opts' value, the joins, the
field path traveled to generate the joins, and a transform function
that takes a field and alias and is equivalent to `field.get_col(alias)`
in the simple case but wraps field transforms if they were included in
names.

The target field is the field containing the concrete value. Final
field can be something different, for example foreign key pointing to
that value. Final field is needed for example in some value
conversions (convert 'obj' in fk__id=obj to pk val using the foreign
key field for example).
c                 óL   >• TR                   (       d  S nU R                  U5      $ r4   rð   )r¶   r½   r\   s     €r;   Úfinal_transformerÚ,Query.setup_joins.<locals>.final_transformer  s   ø€ Ø—?—?Ø�Ø—=‘= Ó'Ð'rC   Nr   rû  T)r±  r±   c                ó’   >•  U" X5      nTR                  XB5      $ ! [         a     [        T[        5      (       a	  T(       a  Tee f = fr4   )rQ  r   rF   r   )r¶   r½   r6   ÚpreviousÚwrappedrK   Úlast_field_exceptionr\   s        €€€r;   Ú	transformÚ$Query.setup_joins.<locals>.transform3  sK   ø€ ðÙ& uÓ4�GØ×-Ñ-¨gÓ<Ð<øÜ!ó ä! +¬u×5Ñ5Ö:NØ2Ð2àðús	   ƒ œ*A)r6   rÀ  )rž  )rö   rý  )Úranger³   r7  r   Ú	functoolsÚpartialÚhas_transformsrž  r`   r½   r¬  Údirectrq  r  Ú
join_classrõ  r    r®  rj  r³  rN   rJ   )r\   r°  rA   r½   r/  rk  rý  rM   r½  ÚpivotrN   rL   ÚrestrW  Úexcr6   rÃ  rj  rž  r·  rÅ  r’   rö   rK   rÂ  s   `                      @@r;   r  ÚQuery.setup_joinsè  sÇ  ú€ ðN �ˆõ	(ð  $ÐÜœ3˜u›: q¨"Ö-ˆEðØ37×3EÑ3EØ˜&˜5�MØØØ$(ð	 4Fð 4Ñ0��k 7ð  # 6˜]�
Ùñ' .ó( ˆD÷	ô !*× 1Ò 1Ø ñ!Ðð 04ÐÖ,ñ! ó( ˆDØ×%×%Ø$(×$:Ñ$:×$@Ñ$@Ó$BÐ!Ø/×5Ñ5‘à$(Ð!Ø"�Ø—<‘<ˆDØ�{�{Ø×+Ñ+¨D¯O©OÓ<‘à�ØŸ™Ø—‘ØØÜØ—‘ØØ"3ð )ð ˆJð "&§§Ö-I‘IÈtˆEØ—I‘IØØØ-Ið ð ˆEð
 �L‰L˜Ôß Ð Ø).©q¨Ð!Ö&ñ; ô< ˜ W¨d¸4ÓSÐSøô} ó /Ø˜A“:ð à+.×(ûð/ús   ©FÆ
F"Æ	FÆF"c                 ó¨  ^
• USS n[        [        U5      5       GH  u  pE[        U5      S:X  d  UR                  (       d    OûUR                  (       a    OèUR
                  R                   Vs1 s H  ofR                  iM     nnU Vs1 s H  ofR                  iM     nnUR                  U5      (       d    O†UR
                  R                   V	s0 s H+  n	U	S   R                  U;   d  M  U	S   R                  U	S   _M-     sn	m
[        U
4S jU 5       5      nU R                  UR                  5       5        GM!     XS   U4$ s  snf s  snf s  sn	f )aš  
The 'target' parameter is the final field being joined to, 'joins'
is the full list of join aliases. The 'path' contain the PathInfos
used to create the joins.

Return the final target field and table alias and the new active
joins.

Always trim any direct join if the target column is already in the
previous table. Can't trim reverse joins as it's unknown if there's
anything on the other side of the join.
Nr±   r   c              3   óB   >#   • U  H  nTUR                      v •  M     g 7fr4   )Úcolumn)r9   ÚtÚtargets_dicts     €r;   r<   Ú#Query.trim_joins.<locals>.<genexpr>�  s   øé € ÐDºG°q˜L¨¯©Ö2ºGùs   ƒrû  )rØ  Úreversedr³   rÉ  rž  r  Úforeign_related_fieldsrÑ  ÚissubsetÚrelated_fieldsr�   r{  rà   )r\   rL   rM   rN   rÜ  ÚinforÒ  Újoin_targetsÚcur_targetsÚrrÓ  s             @r;   rp  ÚQuery.trim_joinse  s   ø€ ð ‘a�ˆÜ"¤8¨D£>×2‰IˆCÜ�5‹z˜Q‹ d§k§kÙØ×%×%ÙØ.2¯o©o×.TÒ.TÓUÒ.T¨ŸHœHÑ.TˆLÐUÙ-4Ó5ªW¨Ÿ8œ8©WˆKÐ5Ø×'Ñ'¨×5Ñ5Ùð Ÿ™×7Ò7óâ7�AØ�Q‘4—;‘; +Ñ-ó "��!‘—‘˜Q˜q™TÒ!Ù7ñˆLô
 ÔD¹GÓDÓDˆGØ×Ñ˜UŸY™Y›[×)ñ 3ð  ˜b™	 5Ð(Ð(ùò VùÚ5ùòs   Á.EÂ	E
ÃEÃ+Ec              #   ó„  #   • U H²  n[        U[        5      (       a  Uv •  M  U(       a5  [        [        USS 5      5      (       a  UR	                  5        S h  v•N   MZ  [        US5      (       d  Mm  U(       d  [        U[        5      (       a  M‹  U R                  UR                  5       UUS9 S h  v•N   M´     g  Nc N7f)Nr  rJ  )r  r  )	rF   r   Úcallablerµ   r  rç   r   r!  rJ  )Úclsr  r  r  r7  s        r;   r!  ÚQuery._gen_cols…  s¨   é € ãˆDÜ˜$¤×$Ñ$Ø”
Þ!¤hÜ˜Ð1°4Ó8÷'ñ 'ð  ×1Ñ1Ó3×3Ò3Ü˜Ð7×8Ó8Þ#¬
°4¼×(=Ñ(=ÙØŸ=™=Ø×/Ñ/Ó1Ø%5Ø!-ð )ð ÷ ò ò ñ 4ñùs+   ‚AC ÁB<ÁC Á2A C Â2B>Â3
C Â>C c              #   óP   #   • S U R                  U5       5        S h  v•N   g  N7f)Nc              3   ó8   #   • U  H  oR                   v •  M     g 7fr4   )r½   )r9   r7  s     r;   r<   Ú)Query._gen_col_aliases.<locals>.<genexpr>™  s   é € Ð@Ò+? 4—J–JÒ+?ùrO  )r!  )rà  r  s     r;   Ú_gen_col_aliasesÚQuery._gen_col_aliases—  s   é € á@¨3¯=©=¸Ô+?Ó@×@Ó@ùs   ‚&ž$Ÿ&c                 óŒ  • U R                   R                  U5      nUb‹  U(       dF  U R                  U/5       H0  n[        U R                  U   [
        5      (       d  M'  [        S5      e   U(       a5  XR                  ;  a  [        SU-  5      e[        XR                  U   5      $ U$ UR                  [        5      nU R                   R                  US   5      nUb  USS   H  nU R                  XX5      nM     U$ U R                  XpR                  5       U R                  5       US9n	U R                  U	R                   U	R"                  U	R$                  5      u  p«nU(       d  ['        U5      S:”  a  [        S5      e['        U
5      S:”  a  [        S5      eU	R)                  U
S   U5      nUb  UR+                  U5        U$ )Nrj  zCCannot aggregate over the '%s' alias. Use annotate() to promote it.r   r±   )r/  z?Referencing multicolumn fields with F() objects isn't supported)r¬   r"  rå  rF   r¦   r&   r   r[   r   r©  r   rQ  r  rÓ   r  rp  rL   rM   rN   r³   rO   r  )r\   r6   rõ   rö   r÷   r  r½   Ú
field_listrÃ  r
  rL   Úfinal_aliasr{  s                r;   Úresolve_refÚQuery.resolve_ref›  sÂ  € Ø×%Ñ%×)Ñ)¨$Ó/ˆ
ØÑ!ÞØ!×2Ñ2°J°<Ö@�EÜ! $§.¡.°Ñ"7¼×>Ó>Ü(ØUóð ñ Aö
 ð
 ×5Ñ5Ó5Ü$ð)Ø+/ñ0óð ô ˜4×!7Ñ!7¸Ñ!=Ó>Ð>à!Ð!àŸ™¤JÓ/ˆJØ×)Ñ)×-Ñ-¨j¸©mÓ<ˆJØÑ%Ø!+¨A¨B£�IØ!%×!3Ñ!3°JÓ!J’Jñ "0à!Ð!Ø×(Ñ(ØŸM™M›O¨T×-CÑ-CÓ-EÐQVð )ð ˆIð /3¯o©oØ×!Ñ! 9§?¡?°I·N±Nó/Ñ+ˆG )ö ¤3 y£>°AÓ#5Ü ØMóð ô �7‹|˜aÓÜ ØUóð ð
 "×4Ñ4°W¸Q±ZÀÓMˆIØÑ Ø—‘˜YÔ'ØÐrC   c                 óJ  • U R                  U R                  5      nU R                  Ul        Uu  pV[        U[        5      (       a  [	        U5      nO*[        U[
        5      (       a  [	        UR                  5      nUR                  XV5        UR                  SS9  UR                  U5      u  pxUR                  S   n	U	R                  n
U	R                  nX²;   a¯  U
R                  R                  R                  nUR                  U 5        U
R!                  S5      nU" UR#                  UR                  S   R                  5      UR#                  U5      5      nUR$                  R'                  U[(        5        SUR*                  U'   U
R!                  S5      nU" U	[-        U5      5      nUR$                  R'                  U[(        5        U R/                  [1        U5      5      u  nnU(       a0  U R/                  SU-  S4SSUS9u  nnUR'                  U[2        5        UU4$ )aL  
When doing an exclude against any kind of N-to-many relation, we need
to use a subquery. This method constructs the nested query, given the
original exclude filter (filter_expr) and the portion up to the first
N-to-many relation field.

For example, if the origin filter is ~Q(child__name='foo'), filter_expr
is ('child__name', 'foo') and can_reuse is a set of joins usable for
filters in the original query.

We will turn this into equivalent of:
    WHERE NOT EXISTS(
        SELECT 1
        FROM child
        WHERE name = 'foo' AND child.parent_id = parent.id
        LIMIT 1
    )
Tr  r   rN  z
%s__isnull)rg  rf  r/  )rz   r¤   r®   rF   r   r   r6   r…  r  Ú
trim_startr´   r²   r½   rÒ   r  rw  rR  rñ   r«   r   r(   r¨   r   r  r   r)   )r\   rr  r/  ro  râ   rƒ  r„  Útrimmed_prefixÚcontains_louterr:  Úselect_fieldr½   r  rY  r8  rs  r–  Úor_null_conditionr0  s                      r;   rn  ÚQuery.split_excludeÍ  sÞ  € ð( —‘˜tŸz™zÓ*ˆØ$(×$<Ñ$<ˆÔ!Ø!,Ñˆ
Ü�j¤(×+Ñ+Ü! *Ó-‰JÜ˜
¤A×&Ñ&Ü! *§/¡/Ó2ˆJØ×Ñ˜Ô0Ø×Ñ 4ÐÑ(ð +0×*:Ñ*:¸?Ó*KÑ'ˆà�l‰l˜1‰oˆØ—z‘zˆØ—	‘	ˆØÓØ×#Ñ#×)Ñ)×,Ñ,ˆBð ×Ñ˜dÔ#Ø'×2Ñ2°7Ó;ˆLñ " "§*¡*¨U¯\©\¸!©_×-BÑ-BÓ"CÀRÇZÁZÐPUÓEVÓWˆFØ�K‰K�O‰O˜F¤CÔ(Ø,0ˆE×"Ñ" 5Ñ)à#×.Ñ.¨wÓ7ˆÙ˜cÔ#3°NÓ#CÓDˆØ�‰�‰˜¤Ô$Ø"&×"3Ñ"3´F¸5³MÓ"BÑˆ	�<æØ#'×#4Ñ#4Ø Ñ.°Ð5Ø $Ø#Ø#ð	 $5ð $Ñ Ð˜qð �M‰MÐ+¬RÔ0ð ˜,Ð&Ð&rC   c                 óš   • U R                   R                  [        5       [        5        U R                   H  nUR                  5         M     g r4   )r«   r   r+   r(   rÚ   Ú	set_empty)r\   râ   s     r;   rô  ÚQuery.set_empty  s0   € Ø�
‰
�‰”{“}¤cÔ*Ø×*Ô*ˆEØ�O‰OÖò +rC   c                 óN   • [        S U R                  R                   5       5      $ )Nc              3   óB   #   • U  H  n[        U[        5      v •  M     g 7fr4   )rF   r+   )r9   Úcs     r;   r<   Ú!Query.is_empty.<locals>.<genexpr>  s   é € ÐKÒ7J°!”:˜a¤×-Ð-Ò7Jùs   ‚)r  r«   rE   r|   s    r;   Úis_emptyÚQuery.is_empty  s   € ÜÑK°t·z±z×7JÒ7JÓKÓKÐKrC   c                 óŽ  • UbJ  U R                   b)  [        U R                   U R                  U-   5      U l         OU R                  U-   U l         UbJ  U R                   b)  [        U R                   U R                  U-   5      U l        OU R                  U-   U l        U R                  U R                   :X  a  U R                  5         gg)aW  
Adjust the limits on the rows retrieved. Use low/high to set these,
as it makes it more Pythonic to read and write. When the SQL query is
created, convert them to the appropriate offset and limit values.

Apply any limits passed in here to the existing constraints. Add low
to the current low value and clamp both to any existing high value.
N)rY   ÚminrX   rô  )r\   ÚlowrW  s      r;   r]  ÚQuery.set_limits  s˜   € ð ÑØ�~‰~Ñ)Ü!$ T§^¡^°T·]±]ÀTÑ5IÓ!J�•à!%§¡°Ñ!5�”Ø‰?Ø�~‰~Ñ)Ü # D§N¡N°D·M±MÀCÑ4GÓ H�•à $§¡°Ñ 3�”à�=‰=˜DŸN™NÓ*Ø�N‰NÕð +rC   c                 ó"   • Su  U l         U l        g)zClear any existing limits.rS   N©rX   rY   r|   s    r;   r$  ÚQuery.clear_limits1  s   € à(/Ñ%ˆŒ�t•~rC   c                 óJ   • U R                   S:g  =(       d    U R                  S L$ rf   r  r|   s    r;   r  ÚQuery.is_sliced5  s   € à�}‰} Ñ!×? T§^¡^¸4Ð%?Ð?rC   c                 ód   • U R                   S L=(       a    U R                   U R                  -
  S:H  $ )Nr±   )rY   rX   r|   s    r;   Úhas_limit_oneÚQuery.has_limit_one9  s)   € Ø�~‰~ TÐ)×S¨t¯~©~ÀÇÁÑ/MÐRSÑ.SÐSrC   c                 ó$   • U R                   (       + $ )z�
Return True if adding filters to this instance is still possible.

Typically, this means no limits or offsets have been put on the results.
)r  r|   s    r;   Ú
can_filterÚQuery.can_filter<  s   € ð —>‘>Ô!Ð!rC   c                 ór   • SU l         SU l        SU l        U R                  S5        U R	                  S5        g)z%Remove all fields from SELECT clause.r‰   FN)r´   r  rÞ   r€  r  r|   s    r;   r\  ÚQuery.clear_select_clauseD  s5   € àˆŒØ!ˆÔØ#ˆÔØ×Ñ˜BÔØ× Ñ  Õ$rC   c                 ó    • SU l         SU l        g)z�
Clear the list of fields to select (but not extra_select columns).
Some queryset types completely replace any existing list of select
columns.
r‰   N©r´   Úvalues_selectr|   s    r;   Úclear_select_fieldsÚQuery.clear_select_fieldsL  s   € ð ˆŒØˆÕrC   c                 ó\   • U =R                   U4-  sl         U =R                  U4-  sl        g r4   r  )r\   r:  r6   s      r;   Úadd_select_colÚQuery.add_select_colU  s%   € Ø�Š˜�vÑ�Ø×Ò˜t˜gÑ%ÖrC   c                 ó2   • SU l         [        U5      U l        g ©NF)r  r�   r´   )r\   Úcolss     r;   r~  ÚQuery.set_selectY  s   € Ø!ˆÔÜ˜D“kˆ�rC   c                 ó   • Xl         SU l        g)zG
Add and resolve the given fields to the query's "distinct on" clause.
TN)rv  r  )r\   rª  s     r;   Úadd_distinct_fieldsÚQuery.add_distinct_fields]  s   € ð  +ÔØˆ�rC   c           	      óâ  • U R                  5       nU R                  5       n / nU H„  nU R                  UR                  [        5      XCUS9nU R                  UR                  UR                  UR                  5      u  p‰n
U H#  nUR                  UR                  X¹5      5        M%     M†     U(       a  U R                  U5        gg! [         a    [        SW-  5      e[         a…    [        W;   a  e X`R                  ;   a  [        SU-  5      e[        / [!        U5      QU R"                  QU R$                  QU R&                  Q5      n[        SU< SSR)                  U5      < 35      ef = f)z]
Add the given (model) fields to the select set. Add the field names in
the order specified.
)rk  zInvalid field name: '%s'z;Cannot select the '%s' alias. Use annotate() to promote it.r¨  z into field. Choices are: r¦  N)r  rÓ   r  r©  r   rp  rL   rM   rN   r³  rO   r~  r'   r   r¬   rª  rB   r­   r[   r®   rj  )r\   rª  Ú	allow_m2mr½   rA   r  r6   r
  rL   ré  rM   r²   r°  s                r;   rY  ÚQuery.add_fieldsd  s†  € ð
 ×&Ñ&Ó(ˆØ�}‰}‹ˆð)	ØˆDÛ#�ð !×,Ñ,Ø—J‘JœzÓ*¨DÀIð -ð �	ð /3¯o©oØ×%Ñ%Ø—O‘OØ—N‘Nó/Ñ+� eó
 &�FØ—K‘K 	× <Ñ <¸VÓ QÖRó &ñ $ö Ø—‘ Õ%ð øäó 	@ÜÐ7¸$Ñ>Ó?Ð?Üó 	Ü˜TÓ!ð Ø×)Ñ)Ó)Ü ðØ ñ!óð ô
 ðÜ2°4Ó8ðàŸ™ðð ×/Ñ/ðð ×1Ñ1ð	ó�õ !ã)-¨t¯y©y¸Õ/?ðAóð ð'	ús   ¢B$C ÃB&E.c                 óZ  • / nU Hê  n[        U[        5      (       a�  US:X  a  M   UR                  S5      (       a  USS nX0R                  ;   a  ML  U R                  (       a  X0R                  ;   a  Mn  U R                  UR                  [        5      U R                  R                  5        O"[        US5      (       d  UR                  U5        [        USS5      (       d  MÞ  [        SU-  5      e   U(       a  [        S	U-  5      eU(       a  U =R                  U-  sl        gSU l        g)
a  
Add items from the 'ordering' sequence to the query's "order by"
clause. These items are either field names (not column names) --
possibly with a direction prefix ('-' or '?') -- or OrderBy
expressions.

If 'ordering' is empty, clear all ordering from the query.
Ú?Ú-r±   Nr  r  Fz[Using an aggregate in order_by() without also including it in annotate() is not allowed: %szInvalid order_by arguments: %s)rF   ÚstrÚ
startswithr¬   r­   r7  r©  r   r¤   rÒ   rç   r³  rµ   r   r‚  Údefault_ordering)r\   ÚorderingÚerrorsÚitems       r;   Úadd_orderingÚQuery.add_ordering—  sÿ   € ð ˆÛˆDÜ˜$¤×$Ñ$Ø˜3“;ÙØ—?‘? 3×'Ñ'Ø  ˜8�DØ×+Ñ+Ó+ÙØ—:—: $¯*©*Ó"4Ùð ×"Ñ" 4§:¡:¬jÓ#9¸4¿:¹:×;KÑ;KÕLÜ˜TÐ#7×8Ñ8Ø—‘˜dÔ#Ü�tÐ1°5×9Ó9Ü ð:Ø<@ñAóð ñ! ö( ÜÐ=ÀÑFÓGÐGÞØ�MŠM˜XÑ%ŽMà$)ˆDÕ!rC   c                 ó´   • U(       d4  U R                   (       d"  U R                  (       d  U R                  (       a  gSU l        SU l        U(       a  SU l        gg)zö
Remove any ordering settings if the current query allows it without
side effects, set 'force' to True to clear the ordering regardless.
If 'clear_default' is True, there will be no ordering in the resulting
query (not even the model's default).
Nr‰   F)r  rv  r  r‚  rƒ  r$  )r\   r  Úclear_defaults      r;   r  ÚQuery.clear_ordering¼  s@   € ö Ø�N�N˜d×2×2°d×6L×6LàØˆŒØ ˆÔÞØ$)ˆDÕ!ð rC   c                 óÀ  • U(       a±  U R                   (       a   0 n0 n[        U R                   U R                  5       H$  u  pE[        U[        5      (       a  XSU'   M   XRU'   M&     0 UEU R
                  EU l        U R                  U5        [        UR                  5       5      U l        [        U5      U l         [        U R                  5      nU R                  R                  5        Hc  u  pGUR                  5       =n(       d  M  U(       a-  UR                  (       d  UR                  [        XG5      5        MR  UR!                  U5        Me     [        U5      U l        g)a  
Expand the GROUP BY clause required by the query.

This will usually be the set of all non-aggregate fields in the
return data. If the database backend supports grouping by the
primary key, and the query would be equivalent, the optimization
will be made automatically.
N)r  r(  r´   rF   r   r¬   r  r�   r¸   rr   r[   r�   r  r  r³  r   rÇ  r  )	r\   rQ  Úgroup_by_annotationsr  r½   r7  r  r  Úgroup_by_colss	            r;   r[  ÚQuery.set_group_byÌ  s  € ö ˜T×/×/ð $&Ð ØˆMÜ" 4×#5Ñ#5°t·{±{ÖC‘�Ü˜d¤C×(Ñ(Ø+/ %Ó(à26¨Ó/ñ	  Dð
  LÐ"6ÐK¸$×:JÑ:JÐKˆDÔØ×'Ñ'Ð(<Ô=Ü × 4Ñ 4Ó 6Ó7ˆDŒKÜ!& }Ó!5ˆDÔÜ˜Ÿ™Ó$ˆØ!%×!7Ñ!7×!=Ñ!=Ö!?ÑˆEØ%/×%AÑ%AÓ%CÐC�MÕCÙÞ Z×%B×%BØ—‘¤ EÓ 6Ö7à—‘ Ö.ñ "@ô ˜h›ˆ�rC   c                 óÞ   • [        U R                  [        5      (       a  0 nOU R                  nU H3  nUnUR                  [        5       H  nUR                  U0 5      nM     M5     X l        g)z“
Set up the select_related data structure so that we only select
certain related models (as opposed to all models, when
self.select_related=True).
N)rF   rÞ   Úboolr©  r   r�  )r\   ÚfieldsÚ
field_dictr¶   Údr­  s         r;   Úadd_select_relatedÚQuery.add_select_relatedí  sa   € ô �d×)Ñ)¬4×0Ñ0Ø‰Jà×,Ñ,ˆJÛˆEØˆAØŸ™¤JÖ/�Ø—L‘L  rÓ*’ó 0ñ ð )ÕrC   c                 ó’  • U(       aÖ  0 nU(       a  [        U5      nO[        / 5      nUR                  5        H‡  u  pšU R                  U	5        [        U
5      n
/ nU
R	                  S5      nUS:w  aH  US:X  d  X¬S-
     S:w  a  UR                  [        U5      5        U
R	                  SUS-   5      nUS:w  a  MH  X«4Xy'   M‰     U R                  R                  U5        U(       d  U(       a)  U R                  R                  [        X45      [        5        U(       a  U =R                  [        U5      -  sl        U(       a  X`l        gg)zU
Add data to the various extra_* attributes for user-created additions
to the query.
z%srû  r   r±   Ú%rq  N)rs   r�   r  r"  Úfindr³  r·   r­   r  r«   r   r*   r(   r�  r�   rƒ  )r\   r´   Úselect_paramsr«   rT   Útablesr‚  Úselect_pairsÚ
param_iterr6   ÚentryÚentry_paramsrÜ  s                r;   Ú	add_extraÚQuery.add_extraý  s  € ö
 ð
 ˆLÞÜ! -Ó0‘
ä! "›X�
Ø%Ÿ|™|ž~‘�Ø× Ñ  Ô&Ü˜E›
�Ø!�Ø—j‘j Ó&�Ø˜R“iØ˜a“x 5¨q©¡>°SÓ#8Ø$×+Ñ+¬D°Ó,<Ô=ØŸ*™* T¨3°©7Ó3�Cð ˜R•ið ',Ð%:�Ó"ñ  .ð �J‰J×Ñ˜lÔ+Þ–FØ�J‰J�N‰Nœ: eÓ4´cÔ:ÞØ×Ò¤ v£Ñ.ÕÞØ"*Õð rC   c                 ó&   • [        5       S4U l        g)z0Remove any fields from the deferred loading set.TN)Ú	frozensetr¨  r|   s    r;   Úclear_deferred_loadingÚQuery.clear_deferred_loading	  s   € ä!*£¨dÐ 3ˆÕrC   c                 ó  • U R                   u  p#U(       a  UR                  U5      S4U l         gUR                  U5      =n(       a
  US4U l         gU R                  5         [	        U5      R                  U5      =n(       a
  US4U l         gg)a:  
Add the given list of model field names to the set of fields to
exclude from loading from the database when automatic column selection
is done. Add the new field names to any existing field names that
are deferred (or removed from any existing field names that are marked
as the only ones for immediate loading).
TFN)r¨  rR  r  rE  r>   )r\   rª  Úexistingr«  Únew_existingÚnew_onlys         r;   Úadd_deferred_loadingÚQuery.add_deferred_loading"	  sˆ   € ð ×/Ñ/‰ˆÞà$,§N¡N°;Ó$?ÀÐ$EˆDÕ!ð  (×2Ñ2°;Ó?Ð?ˆ|Õ?Ø(4°eÐ(;�Õ%à×+Ñ+Ô-Ü" ;Ó/×:Ñ:¸8ÓDÐD�8ÕDØ,4°d¨N�DÕ)ð ErC   c                 ó.  • U R                   u  p#[        U5      nSU;   aD  UR                  S5        UR                  U R	                  5       R
                  R                  5        U(       a  UR                  U5      S4U l         g[        U5      S4U l         g)aÍ  
Add the given list of model field names to the set of fields to
retrieve when the SQL is executed ("immediate loading" fields). The
field names replace any existing immediate loading field names. If
there are field names already specified for deferred loading, remove
those names from the new field_names before storing the new names
for immediate loading. (That is, immediate loading overrides any
existing immediate values, but respects existing deferrals.)
r  FN)	r¨  r>   Úremover   rÓ   r  r6   r  rD  )r\   rª  rH  r«  s       r;   Úadd_immediate_loadingÚQuery.add_immediate_loading;	  s€   € ð ×/Ñ/‰ˆÜ˜+Ó&ˆØ�;ÓØ×Ñ˜tÔ$Ø�O‰O˜DŸM™M›O×.Ñ.×3Ñ3Ô4æð %0×$:Ñ$:¸8Ó$DÀeÐ$KˆDÕ!ô %.¨kÓ$:¸EÐ$AˆDÕ!rC   c                 óH   • Uc  SU l         O[        U5      U l         SU l        g)z@Set the mask of annotations that will be returned by the SELECT.N)rÙ   r>   rÛ   ©r\   r°  s     r;   r  ÚQuery.set_annotation_maskS	  s#   € à‰=Ø*.ˆDÕ'ä*-¨e«*ˆDÔ'Ø(,ˆÕ%rC   c                 ót   • U R                   b+  U R                  U R                   R                  U5      5        g g r4   )rÙ   r  rR  rR  s     r;   r  ÚQuery.append_annotation_mask[	  s2   € Ø×&Ñ&Ñ2Ø×$Ñ$ T×%@Ñ%@×%FÑ%FÀuÓ%MÕNð 3rC   c                 óH   • Uc  SU l         O[        U5      U l         SU l        g)z†
Set the mask of extra select items that will be returned by SELECT.
Don't remove them from the Query since they might be used later.
N)rÜ   r>   rÝ   rR  s     r;   r€  ÚQuery.set_extra_mask_	  s%   € ð
 ‰=Ø%)ˆDÕ"ä%(¨£ZˆDÔ"Ø#'ˆÕ rC   c                 ó²  • SU l         U R                  5         U R                  5         SU l        U(       aÌ  / n/ n/ nU R                  (       d  U R
                  (       d  [        U5      nOeSU l        U HX  nXPR                  ;   a  UR                  U5        M%  XPR                  ;   a  UR                  U5        MG  UR                  U5        MZ     U R                  U5        U R                  U5        [        X#-   U-   5      nODU R                  R                  R                    Vs/ s H  oUR"                  PM     nn[        U5      nU R$                  SL aW  U R'                  S U R                  R                  R                    5       S5        U R)                  SS9  U R                  5         O…U R$                  (       at  / nU R$                   HR  n[+        U[,        5      (       a)  UR.                  U;  a  U R
                  UR.                     nUR                  U5        MT     [1        U5      U l        [1        U5      U l        U R'                  US5        g s  snf )NFTc              3   ó8   #   • U  H  oR                   v •  M     g 7fr4   rM  r8   s     r;   r<   Ú#Query.set_values.<locals>.<genexpr>‹	  s   é € ÐEÒ$D˜q—–Ò$DùrO  rP  )rÞ   rE  r  rD  r­   r¬   rr   r  rZ   r³  r[   r€  r  rD  r¤   rÒ   rZ  r7   r  rY  r[  rF   r   Úrefsr�   r  )	r\   r3  rª  Úextra_namesÚannotation_namesr:   Úselectedr  r7  s	            r;   Ú
set_valuesÚQuery.set_valuesj	  sä  € Ø#ˆÔØ×#Ñ#Ô%Ø× Ñ Ô"Ø!%ˆÔæØˆKØˆKØ!ÐØ—:—: d×&6×&6ô # 6›l‘à$)�Ô!Û�AØ×-Ñ-Ó-Ø#×*Ñ*¨1Ö-Ø×4Ñ4Ó4Ø(×/Ñ/°Ö2à#×*Ñ*¨1Ö-ñ  ð ×Ñ Ô,Ø×$Ñ$Ð%5Ô6Ü  Ñ!:Ð=MÑ!MÓN‰Hà.2¯j©j×.>Ñ.>×.NÒ.NÓOÒ.N¨Ÿ9œ9Ñ.NˆKÐOÜ  Ó-ˆHð �=‰=˜DÒ Ø�O‰OÙE D§J¡J×$4Ñ$4×$DÒ$DÓEÀuôð
 ×Ñ¨EÐÑ2Ø×$Ñ$Õ&Ø�]�]ð ˆHØŸœ�Ü˜d¤C×(Ñ(¨T¯Y©Y¸hÓ-FØ×+Ñ+¨D¯I©IÑ6�DØ—‘ Ö%ñ &ô " (›OˆDŒMä" ;Ó/ˆÔØ�‰˜ TÕ*ùò/ Ps   Ä$Ic                 ó:  • U R                   b  U R                   $ U R                  (       d  0 $ U R                  bQ  U R                  R                  5        VVs0 s H  u  pXR                  ;   d  M  X_M     snnU l         U R                   $ U R                  $ s  snnf )zŒ
Return the dictionary of aggregate columns that are not masked and
should be used in the SELECT clause. Cache this result for performance.
)rÛ   r¬   rÙ   r�   ©r\   rx  rE  s      r;   r[   ÚQuery.annotation_selectž	  s˜   € ð ×(Ñ(Ñ4Ø×0Ñ0Ð0Ø×!×!ØˆIØ×(Ñ(Ñ4ð !×,Ñ,×2Ñ2Ô4ô-â4‘D�AØ×3Ñ3Ñ3ó �’Ù4ò-ˆDÔ)ð
 ×0Ñ0Ð0à×#Ñ#Ð#ùó-ó   ÁBÁ0Bc                 ó:  • U R                   b  U R                   $ U R                  (       d  0 $ U R                  bQ  U R                  R                  5        VVs0 s H  u  pXR                  ;   d  M  X_M     snnU l         U R                   $ U R                  $ s  snnf r4   )rÝ   r­   rÜ   r�   rb  s      r;   rZ   ÚQuery.extra_select²	  sŠ   € à×#Ñ#Ñ/Ø×+Ñ+Ð+Ø�z�zØˆIØ×#Ñ#Ñ/à!%§¡×!1Ñ!1Ô!3ô(Ú!3™˜°q×<RÑ<RÑ7R“�’Ñ!3ò(ˆDÔ$ð ×+Ñ+Ð+à—:‘:Ðùó(rd  c                 ó¢  • / nU H  u  p4UR                  U5        M     SnU R                   Vs/ s H%  ofU R                  ;   d  X`R                  :X  d  M#  UPM'     nn[	        U5       HU  u  p‰U	R
                  (       a    OAU R                  XxS-         R                  [        :X  a  SnXx   n
U R                  U
5        MW     W	R                  R                  nWn/ nU H8  u  péU[        U	5      -
  S:  a    O#UR                  U5        U[        U	5      -  nM:     UR                  UR                  S   R                  5        [        R                   " U5      nU R                  XxS-         nUR                  [        :w  a‰  UR"                  (       dx  UR$                   Vs/ s H  nUS   PM
     nnXxS-      nU R                  Xx   5        UR'                  SXxS-      5      nU(       a   U R(                  R+                  U[,        5        O#UR$                   Vs/ s H  nUS   PM
     nnXx   nU R                   HN  nU R.                  U   S:”  d  M  U R1                  U R                  U   R2                  U5      U R                  U'     O   U R5                  U Vs/ s H  nUR7                  U5      PM     sn5        XÕ4$ s  snf s  snf s  snf s  snf )a®  
Trim joins from the start of the join path. The candidates for trim
are the PathInfos in names_with_path structure that are m2m joins.

Also set the select column so the start matches the join.

This method is meant to be used for generating the subquery joins &
cols in split_exclude().

Return a lookup usable for doing outerq.filter(lookup=self) and a
boolean indicating if the joins in the prefix contain a LEFT OUTER join.
_Fr±   Tr   N)rÇ  r¦   rm  r¾   rØ  r®  rs  r!   r{  r  r¶   r³   r³  rÖ  r6   r   rj  rž  rØ  Úget_extra_restrictionr«   r   r(   r¥   rô  r´  r~  rñ   )r\   ro  Ú	all_pathsr0  Úpathsrï  rÒ  Úlookup_tablesÚtrimmed_pathsrN   r½   r  Úpaths_in_prefixrî  r6   Ú
first_joinrÜ  Úselect_fieldsÚselect_aliasÚextra_restrictionr  r:   s                         r;   rí  ÚQuery.trim_startÀ	  s¦  € ð ˆ	Û'‰HˆAØ×Ñ˜UÖ#ñ (àˆð
 —~’~ó
Ú%�!¨d×.@Ñ.@Ó)@ÀAÏÉÑDX�A‘~ð 	ð 
ô $-¨YÖ#7ÑˆMØ�x�xÙØ�~‰~˜m¸AÑ,=Ñ>Ñ?×IÑIÌVÓSØ"&�Ø!Ñ0ˆEØ×Ñ˜UÖ#ñ $8ð —_‘_×*Ñ*ˆ
à'ˆØˆÛ)‰JˆDØ¤ T£Ñ*¨QÓ.ÙØ×!Ñ! $Ô'Øœs 4›yÑ(ŠOñ	 *ð
 	×Ñ˜j×?Ñ?ÀÑB×GÑGÔHÜ#Ÿš¨Ó8ˆð —^‘^ MÀ!Ñ2CÑ$DÑEˆ
Ø×Ñ¤6Ó)°*×2N×2NØ+5×+DÒ+DÓEÒ+D a˜Q˜qœTÑ+DˆMÐEØ(¸Ñ):Ñ;ˆLØ×Ñ˜]Ñ9Ô:Ø *× @Ñ @Ø�m°AÑ$5Ñ6ó!Ðö !Ø—
‘
—‘Ð0´#Ô6øð
 ,6×+DÒ+DÓEÒ+D a˜Q˜qœTÑ+DˆMÐEØ(Ñ7ˆLð —^”^ˆEØ×"Ñ" 5Ñ)¨AÕ-Ø(,×(=Ñ(=Ø—N‘N 5Ñ)×4Ñ4Øó)�—‘˜uÑ%ñ ñ $ð 	�‰¹-ÓHº-°Q˜Ÿ™ <Ö0¹-ÑHÔIØÐ.Ð.ùòo
ùò< Fùò Fùò Is   ¯"J=ÁJ=ÆKÈKÊKc                 ó�   • UR                   =(       d4    UR                  =(       a!    [        [           R                  R
                  $ )zñ
Check if the given field should be treated as nullable.

Some backends treat '' as null and Django treats such fields as
nullable for those backends. In such situations field.null can be
False even if we should treat the field as nullable.
)ÚnullÚempty_strings_allowedr   r   rp   rT  )r\   r¶   s     r;   rq  ÚQuery.is_nullable
  s9   € ð �z‰z÷ 
Ø×'Ñ'÷ YÜÔ,Ñ-×6Ñ6×XÑXð	
rC   ) rÛ   rÝ   r®   rm  r§   r¦   r²  r¥   rÙ   r¬   r  r$  r¨  r  rv  r¨   r­   rƒ  rÜ   r  rD  rY   rX   r¤   r‚  r´   rÞ   rÖ   r©   rª   r  r«   )T)NNTr4   )FN)r±   r  )F)FFNTTFTF)FFTTTF)FF)TF)NTF)FT)TNF)NN)�r{   r•   r–   r—   r˜   r²  r#  rD  rÖ   rÎ   r$   rô  r&   rÊ  r  r$  Ústandard_orderingræ   r  r´   r  r‚  rX   rY   r  rv  r  Úselect_for_update_nowaitÚselect_for_update_skip_lockedÚselect_for_update_ofÚselect_for_no_key_updaterÞ   rD  Ú	max_depthr  rÙ   rÛ   r  Úcombinator_allrÚ   rÜ   rÝ   r�  rƒ  r¨  ri  r]   r™   r¹   r-   r¾   r…   rÁ   rÊ   rÄ   rÓ   r`   r   rí   rò   rA  rF  rI  rU  rb  rm  r�  r”  r¤  r®  r·  r»  r{  rÊ  rÎ  rÔ  rë   rw  r  rø  rj  r  r  r^  r  r  r  rÅ   r-  r=  rA  rF  rK  rZ  rQ  r  r…  r‚  rŒ  r�  rl  r™  r£  r7  r  rp  Úclassmethodr!  rå  rê  rn  rô  rú  r]  r$  r  r  r	  r\  r  r  r~  r  rY  r(  r  r[  r6  rA  rE  rK  rO  r  r  r€  r_  r[   rZ   rí  rq  rš   r‰   rC   r;   r0   r0   ž   s�  † Ùà€LØ!ÐÙ˜l˜^Ó,€Là€Hà ÐØ€Jà€LØÐØÐàÐØ€Hð €Fð €HØ€HØ€HØ€IØ€HØ€OØÐØ$ÐØ$)Ð!ØÐØ$ÐØ€NØÐà€Ið €Mð "ÐØ#Ðð €JØ€NØÐð ÐØÐà€LØ€Nñ "› TÐ*Ðà€Lô&ð8 ñLó ðLð ñó ðò	ò<òô
ò$ò+ôZòò
,ò
q@òfNòôò,&ô

3òqHôf,ô\ò.6ô,ò6(ô-ò#òJ1ò&2ò+
ôZ5
ònòKô0òd#òBô-òò:
ôòòô(0ò.
òAò.,ò,ò\ð2 ØØØØØ%*ØØôe?òN0ò*ò&Dò!ð ØØØØØô"+ðJ FKôò:Nô>r<ðr ØØ%*ô{Tòz)ð@ óó ðð" ñAó ðAô0òdC'òJò
Lôò.0ð ñ@ó ð@òTò"ò%ò ò&ò"òô1òf#*ôJ*ô (òB)ò +òB4ò;ò2Bò0-òOò	(ò2+ðh ñ$ó ð$ð& ñó ðòK/õZ
rC   c                 óF   • [         U   nU S   S:X  a
  U SS US   4$ XS   4$ )zÿ
Return the field name and direction for an order specification. For
example, '-foo' is returned as ('foo', 'DESC').

The 'default' param is used to indicate which way no prefix (or a '+'
prefix) should sort. The '-' prefix always sorts the opposite way.
r   r!  r±   N)r"   )r¶   ÚdefaultÚdirns      r;   Úget_order_dirr‚   
  s:   € ô �WÑ€DØˆQ�x�3ƒØ�Q�Rˆy˜$˜q™'Ð!Ð!Ø�q‘'ˆ>ÐrC   c                   ó0   • \ rS rSrSrS rS rS rS rSr	g)	rx  i.
  zQ
A class to abstract away join promotion problems for complex filter
conditions.
c                 óÎ   • Xl         X0l        U R                  (       a"  U[        :X  a  [        U l        O[        U l        OU R                   U l        X l        [        5       U l        g r4   )r…  r“  r(   r)   Úeffective_connectorÚnum_childrenr   Úvotes)r\   r…  r†  r“  s       r;   r]   ÚJoinPromoter.__init__4
  sH   € Ø"ŒØŒØ�<�<ØœCÓÜ+-�Õ(ä+.�Õ(à'+§~¡~ˆDÔ$Ø(Ôô “Yˆ�
rC   c                 óˆ   • U R                   R                   SU R                  < SU R                  < SU R                  < S3$ )Nz(connector=z, num_children=z
, negated=Ú))rz   r–   r…  r†  r“  r|   s    r;   r}   ÚJoinPromoter.__repr__C
  sG   € à�~‰~×*Ñ*Ð+¨;°t·~±~Ñ6Hð IØ ×-Ñ-Ñ0°
¸4¿<¹<Ñ:JÈ!ðMð	
rC   c                 ó:   • U R                   R                  U5        g)zH
Add single vote per item to self.votes. Parameter can be any
iterable.
N)r‡  r  )r\   r‡  s     r;   ry  ÚJoinPromoter.add_votesI
  s   € ð
 	�
‰
×Ñ˜%Õ rC   c                 ó¸  • [        5       n[        5       nU R                  R                  5        H…  u  pEU R                  [        :X  a   XPR
                  :  a  UR                  U5        U R                  [        :X  d'  U R                  [        :X  d  Mc  XPR
                  :X  d  Mt  UR                  U5        M‡     UR                  U5        UR                  U5        U$ )zÜ
Change join types so that the generated query is as efficient as
possible, but still correct. So, change as many joins as possible
to INNER, but don't make OUTER joins INNER if that could remove
results from the query.
)
r>   r‡  r�   r…  r)   r†  r   r(   rÊ  rÎ  )r\   râ   Ú
to_promoteÚ	to_demoter  r‡  s         r;   r|  ÚJoinPromoter.update_join_typesP
  s®   € ô “Uˆ
Ü“Eˆ	ð !ŸJ™J×,Ñ,Ö.‰LˆEð ×'Ñ'¬2Ó-°%×:KÑ:KÓ2KØ—‘˜uÔ%ð ×'Ñ'¬3Ó.Ø×(Ñ(¬BÕ.°5×<MÑ<MÕ3Mà—‘˜eÖ$ñ5 /ðT 	×Ñ˜JÔ'Ø×Ñ˜9Ô%ØÐrC   )r…  r…  r“  r†  r‡  N)
r{   r•   r–   r—   r˜   r]   r}   ry  r|  rš   r‰   rC   r;   rx  rx  .
  s   † ñò
ò
ò!õ7rC   rx  )ÚASC)Pr˜   rØ   r^  rÆ  rí  Úcollectionsr   r   Úcollections.abcr   r   Ú	itertoolsr   r   r	   Ústringr
   Údjango.core.exceptionsr   r   Ú	django.dbr   r   r   Údjango.db.models.aggregatesr   Údjango.db.models.constantsr   Údjango.db.models.expressionsr   r   r   r   r   r   r   r   Údjango.db.models.fieldsr   Ú'django.db.models.fields.related_lookupsr   Údjango.db.models.lookupsr   Údjango.db.models.query_utilsr   r   r   Údjango.db.models.sql.constantsr    r!   r"   r#   Ú#django.db.models.sql.datastructuresr$   r%   r&   r'   Údjango.db.models.sql.wherer(   r)   r*   r+   r,   Údjango.utils.functionalr-   Údjango.utils.regex_helperr.   Údjango.utils.treer/   Ú__all__r  rg  rB   rG   rJ   r1   r›   r0   r‚  rx  r‰   rC   r;   Ú<module>r§     sö   ðñó Û Û Û 
ß +ß -ß +Ñ +Ý "ç @ß FÑ FÝ -Ý 1÷	÷ 	ó 	õ *Ý BÝ +÷ñ ÷
 LÓ Kß QÓ Qß RÕ RÝ 3Ý 6Ý "à�JÐ
€ñ +Ð+FÓGÐ ñ +¨:Ó6Ð òòñ ØØMó€÷F.ñ F.ñR ˜Ð(=Ó>€ô%
ˆNô %
ôDL÷Yò YrC   