+
    Tj<                         ^ RI Ht ^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
HtHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt R	.t ! R
 R	4      t ! R R]4      tR# )    )NoneType)checks)names_digestsplit_identifier)ColExpressionListFFuncOrderBy)Collate)Q)Query)	partitionIndexc                      a  ] tR t^t o Rt^tRRRRRRRRRRRR/R	 lt]R
 4       tR t	R t
RR ltR tR tR tR tR tR tRtV tR# )r   idxfieldsnameNdb_tablespace	opclasses	conditionincludec               ^   V'       d   V'       g   \        R 4      h\        V\        \        34      '       g   \        R4      hV'       d   V'       g   \        R4      h\        V\        \
        34      '       g   \        R4      h\        V\        \
        34      '       g   \        R4      hV'       g   V'       g   \        R4      hV'       d   V'       d   \        R4      hV'       d   V'       g   \        R4      hV'       d   V'       d   \        R4      hV'       d%   \        V4      \        V4      8w  d   \        R	4      hV'       dF   \        ;QJ d    R
 V 4       F  '       d   K   RM	  RM! R
 V 4       4      '       g   \        R4      hV'       d   V'       g   \        R4      h\        V\        \        \
        34      '       g   \        R4      h\	        V4      V n        V P                   Uu. uF/  pVP                  R4      VP                  R4      '       d   RMR3NK1  	  upV n        T;'       g    RV n        W0n        W@n        WPn        V'       d   \        V4      MRV n        \
        ;QJ d    . R V 4       F  NK  	  5V n        R# ! R V 4       4      V n        R# u upi )z(An index must be named to use opclasses.z%Index.condition must be a Q instance.z(An index must be named to use condition.z%Index.fields must be a list or tuple.z(Index.opclasses must be a list or tuple.z@At least one field or expression is required to define an index.z4Index.fields and expressions are mutually exclusive.z*An index must be named to use expressions.zgIndex.opclasses cannot be used with expressions. Use django.contrib.postgres.indexes.OpClass() instead.zGIndex.fields and Index.opclasses must have the same number of elements.c              3   B   "   T F  p\        V\        4      x  K  	  R # 5iN)
isinstancestr).0fields   & M/var/www/idalgo/venv/lib/python3.14/site-packages/django/db/models/indexes.py	<genexpr>!Index.__init__.<locals>.<genexpr><   s     I&j44&s   FTz8Index.fields must contain only strings with field names.zA covering index must be named.z&Index.include must be a list or tuple.-DESC c              3   h   "   T F(  p\        V\        4      '       d   \        V4      MTx  K*  	  R # 5ir   )r   r   r	   )r   
expressions   & r    r!   r"   M   s,      !
)
 (
C88AjMjH)s   02N )
ValueErrorr   r   r   listtuplelenallr   removeprefix
startswithfields_ordersr   r   r   r   r   expressions)	selfr   r   r   r   r   r   r1   
field_names	   &$$$$$$* r    __init__Index.__init__   s    TGHH)h]33DEETGHH&4-00DEE)dE]33GHH6R  6F  tIJJ9E  VI6  ##I&I###I&IIIWXX4>??'HdE#:;;EFF6l #kk
)
 $$S)Z5J5J35O5O6UWX)
 JJB	*"")0uW~b 5 !
)!
55 !
)!
 

s   6+J*"	J*c                ,    \        V P                  4      # r   )boolr1   r2   s   &r    contains_expressionsIndex.contains_expressionsR   s    D$$%%    c                  a  . pS P                   ^ ,          R8X  g(   S P                   ^ ,          P                  4       '       d:   VP                  \        P                  ! RS P                   ,          VRR7      4       \        S P                   4      S P                  8  dF   VP                  \        P                  ! RS P                   S P                  3,          VRR7      4       \        4       pS P                  '       d;   S P                   F*  pVP                  R VP                  V4       4       4       K,  	  TP                  TP                  0 S P                   UUu. uF  w  rgVNK	  	  uppmS P                  mVmR4      4       VP                   P"                  pVP$                  P&                  '       g   R	V9   g   \(        ;QJ d3    V 3R
 lVP                   P*                   4       F  '       g   K   RM(	  RM$! V 3R
 lVP                   P*                   4       4      '       d;   VP                  \        P,                  ! RVP.                  ,          RVRR7      4       VP$                  P0                  '       g   RV9   g   \(        ;QJ d0    R VP                   P*                   4       F  '       g   K   RM%	  RM!! R VP                   P*                   4       4      '       d;   VP                  \        P,                  ! RVP.                  ,          RVRR7      4       VP$                  P2                  '       g   RV9   g   \(        ;QJ d0    R VP                   P*                   4       F  '       g   K   RM%	  RM!! R VP                   P*                   4       4      '       d;   VP                  \        P,                  ! RVP.                  ,          RVRR7      4       V# u uppi )z/Check fields, names, and conditions of indexes._z@The index name '%s' cannot start with an underscore or a number.zmodels.E033)objidz8The index name '%s' cannot be longer than %d characters.zmodels.E034c              3   2   "   T F  q^ ,          x  K  	  R# 5i)r   Nr(   )r   refs   & r    r!   Index.check.<locals>.<genexpr>p   s      "&LsFF&Ls   indexessupports_partial_indexesc              3   @   <"   T F  pSP                   R Jx  K  	  R # 5ir   )r   )r   indexr2   s   & r    r!   rB      s     N:M$..,:Ms   TFz,%s does not support indexes with conditions.zLConditions will be ignored. Silence this warning if you don't care about it.zmodels.W037)hintr>   r?   supports_covering_indexesc              3   8   "   T F  qP                   x  K  	  R # 5ir   )r   r   rF   s   & r    r!   rB      s     A-@E---@   z1%s does not support indexes with non-key columns.zQNon-key columns will be ignored. Silence this warning if you don't care about it.zmodels.W040supports_expression_indexesc              3   8   "   T F  qP                   x  K  	  R # 5ir   )r9   rJ   s   & r    r!   rB      s     N:M,,:MrK   z+%s does not support indexes on expressions.zKAn index won't be created. Silence this warning if you don't care about it.zmodels.W043)r   isdigitappendr   Errorr,   max_name_lengthsetr9   r1   update_get_expr_referencesextend_check_local_fieldsr0   r   _metarequired_db_featuresfeaturesrD   anyrC   Warningdisplay_namerH   rL   )	r2   model
connectionerrors
referencesr'   r   r=   rX   s	   f&&      r    checkIndex.checkV   s    99Q<3$))A,"6"6"8"8MM#%)YY/$	 tyy>D000MM"%)YY0D0D$EF$	 U
$$$"..
!! "&+&@&@&L"  / 	%%,0,>,>?,>e,>?\\  
 		
  %{{??888)-AAcN%++:M:MNcccN%++:M:MNNNMMB --.6 $	 999*.BBcAU[[-@-@AcccAU[[-@-@AAAMMG --.> $	 ;;;,0DDcN%++:M:MNcccN%++:M:MNNNMMA --.6 $	 s @s   !O%c                f  a V P                   f   R # \        VRR7      pVP                  V P                   4      pVP                  SP                  R7      pVP                  VSP                  4      w  rgT\        ;QJ d    . V3R lV 4       F  NK  	  5,          # ! V3R lV 4       4      ,          # )NF)r]   
alias_cols)r^   c              3   F   <"   T F  pSP                  V4      x  K  	  R # 5ir   )quote_value)r   pschema_editors   & r    r!   +Index._get_condition_sql.<locals>.<genexpr>   s     HA=44Q77s   !)r   r   build_whereget_compilerr^   as_sqlr+   )r2   r]   rh   querywherecompilersqlparamss   &&f     r    _get_condition_sqlIndex._get_condition_sql   s    >>!Ee4!!$..1%%1I1I%Jll8]-E-EFUUHHUHHUHHHHHr;   c                   V P                    Uu. uF'  qQP                  P                  V4      P                  NK)  	  ppV P	                  W4      pV P
                  '       du   . pV P
                   F:  p	\        V	4      p
V
P                  VP                  4       VP                  V
4       K<  	  \        V!  P                  \        VR R7      4      pRpRpMV P                   UUu. uF   w  r^VP                  P                  V4      NK"  	  pppVP                  P                  P                  '       d#   V P                   Uu. uF  q^,          NK  	  ppMR.\!        V P                  4      ,          pRpVP"                  ! V3RVRV P$                  RVRV P&                  RVR	V P(                  R
VRVRV/	VB # u upi u uppi u upi )F)rd   Nr%   r   r   usingr   col_suffixesr   r   r   r1   )r   rW   	get_fieldcolumnrr   r1   IndexExpressionset_wrapper_classesr^   rO   r   resolve_expressionr   r0   rY   supports_index_column_orderingr,   _create_index_sqlr   r   r   )r2   r]   rh   ru   kwargsr3   r   r   index_expressionsr'   index_expressionr1   r   rv   r=   orders   &&&&,           r    
create_sqlIndex.create_sql   s   GK||
GSKK!!*-44| 	 
 ++EA	 ""..
#2:#>  44]5M5MN!(()9: / )*;<OOe.K FL &*%7%7%7MJ %%j1%7   ''00OOO6:6H6HI6HUa6HI "tc$*<*<&==K..

 
 	

 ,,
 &
 nn
  
 
 $
 
 	
3
 
  Js   -F7$&F<Gc                <    VP                   ! WP                  3/ VB # r   )_delete_index_sqlr   )r2   r]   rh   r~   s   &&&,r    
remove_sqlIndex.remove_sql   s    ..uiiJ6JJr;   c                   V P                   P                  : R V P                   P                  : 2pVP                  RR4      pRV P                  /pV P
                  '       d   V P
                  VR&   V P                  e   V P                  VR&   V P                  '       d   V P                  VR&   V P                  '       d   V P                  VR&   V P                  '       d   V P                  VR&   WP                  V3# )	.zdjango.db.models.indexeszdjango.db.modelsr   r   r   r   r   r   )	__class__
__module____name__replacer   r   r   r   r   r   r1   )r2   pathr~   s   &  r    deconstructIndex.deconstruct   s    ..33T^^5L5LM||68JK$))$;;;#{{F8)&*&8&8F?#>>>"&..F;>>>"&..F;<<< $F9&&//r;   c                L    V P                  4       w  rpV P                  ! V/ VB # )zCreate a copy of this Index.)r   r   )r2   r=   argsr~   s   &   r    cloneIndex.clone   s(    **,~~t.v..r;   c           	     $   \        VP                  P                  4      w  r#V P                   UUu. uF*  w  rEVP                  P	                  V4      P
                  NK,  	  ppp\        W`P                  4       UUUu. uF  w  pw  rEV'       d   RMRV,          NK  	  ppppV.VOV P                  Np	VR,          : RV^ ,          R,          : R\        V	R^/ : RV P                  : 2: 2V n	        \        V P                  4      V P                  8  d   \        R4      hV P                  ^ ,          R8X  g(   V P                  ^ ,          P                  4       '       d"   RV P                  R	,          ,          V n	        R
# R
# u uppi u upppi )z
Generate a unique name for the index.

The name is divided into 3 parts - table name (12 chars), field name
(8 chars) and unique hash + suffix (10 chars). Each part is made to
fit its size by truncating the excess length.
z-%sz%s:N   Nr=   :N   NlengthzVIndex too long for multiple database support. Is self.suffix longer than 3 characters?zD%s:   NNN)r   rW   db_tabler0   rw   rx   zipsuffixr   r   r,   rQ   r)   rN   )
r2   r]   r=   
table_namer3   r   column_namescolumn_namecolumn_names_with_order	hash_datas
   &&        r    set_name_with_modelIndex.set_name_with_model   sg    ))=)=> &*%7%7
%7!
 KK!!*-44%7 	 
 58005#
500j e$+555 	  #
  G"9G4;;G	sOOOB#Y9q94;;G
	
 tyy>D000,  99Q<3$))A,"6"6"8"8		"-DI #9/
#
s   0F=!Fc                   R V P                   P                  : RV P                  '       g   RMR\        V P                  4      ,          : V P                  '       g   RMR\        V P                  4      ,          : V P
                  '       g   RMR\        V P
                  4      ,          : V P                  f   RMR\        V P                  4      ,          : V P                  f   RMRV P                  ,          : V P                  '       g   RMR\        V P                  4      ,          : V P                  '       g   RMR	\        V P                  4      ,          : R
2# )<:r%   z
 fields=%sz expressions=%sz name=%sz db_tablespace=%sz condition=%sz include=%sz opclasses=%s>)
r   __qualname__r   reprr1   r   r   r   r   r   r8   s   &r    __repr__Index.__repr__  s    NN''kkkB|d4;;6G'GG&&&B,=TEUEU@V,VViiiBZ$tyy/%AA %%- (40B0B+CCD ..(Bo.NNlllBT\\8J(JJnnnB/D<P*PP
 	
r;   c                    V P                   VP                   8X  d"   V P                  4       VP                  4       8H  # \        # r   )r   r   NotImplemented)r2   others   &&r    __eq__Index.__eq__-  s5    >>U__,##%):):)<<<r;   )r   r   r1   r   r0   r   r   r   r(   )r%   )r   r   r   __firstlineno__r   rQ   r4   propertyr9   ra   rr   r   r   r   r   r   r   r   __static_attributes____classdictcell__)__classdict__s   @r    r   r      s     F O<
 <
 	<

 <
 <
 <
 <
| & &YvI&
PK0 /
!.F
  r;   c                   f   a a ] tR tRt oRtRt]]3tR	R lt	]
R 4       tR
V 3R lltR tRtVtV ;t# )ry   i3  z7Order and wrap expressions for CREATE INDEX statements.z%(expressions)sc                    V'       dW   VP                   P                  '       d9   \        V P                   Uu. uF  pV\        Jg   K  VNK  	  up4      V n        R # R # R # u upi r   )rY   collate_as_index_expressionr+   wrapper_classesr   )r2   r^   wrapper_clss   && r    rz   #IndexExpression.set_wrapper_classes9  s]    *--III#( (,';';';"'1  K';$D  J:s   A!	A!c                    Wn         R # r   r   )clsr   s   &*r    register_wrappers!IndexExpression.register_wrappersD  s    -r;   c           	     H  <a  \        S P                  4       4      p\        V 3R  lV4      w  rxV U	u. uF  p	\        V	4      NK  	  p
p	\	        V
4      \	        \        V
4      4      8w  dE   \        RRP                  S P                   Uu. uF  qP                  NK  	  up4      ,          4      hV^\	        V4      ^,            V8w  dE   \        RRP                  S P                   Uu. uF  qP                  NK  	  up4      ,          4      hV^,          pVP                  VVVVV4      p\        V\        4      '       g   \        VRR7      pV'       d   \        VV 3R lR7      pV U	u. uF  qP                  4       NK  	  pp	\!        VRR	 4       F$  w  rV	P#                  W^,           ,          .4       K&  	  VR	,          P#                  V.4       S P#                  V^ ,          .4       MS P#                  V.4       \$        SS `)  WW4V4      # u up	i u upi u upi u up	i )
c                 0   < \        V SP                  4      # r   )r   r   )er2   s   &r    <lambda>4IndexExpression.resolve_expression.<locals>.<lambda>S  s    jD$8$89r;   zAMultiple references to %s can't be used in an indexed expression.z, z8%s must be topmost expressions in an indexed expression.z(%(expressions)s))templatec                 L   < SP                   P                  \        V 4      4      # r   )r   rF   type)wr2   s   &r    r   r   v  s    d2288aAr;   )keyN)r*   flattenr   r   r,   rR   r)   joinr   r   r{   r   r   r
   sortedcopy	enumerateset_source_expressionssuper)r2   rm   allow_joinsreuse	summarizefor_saver1   r   wrapperswrapperwrapper_typesr   root_expressionresolve_root_expressionir   s   f&&&&&         r    r{   "IndexExpression.resolve_expressionH  s    4<<>*&/9'
# 7??h7gh?}S%7!88))AEAUAUVAU+--AUV  q3x=1,-9J))AEAUAUVAU+--AUV  ,A."1"D"D#
 1377"?=PQOAH 7??h7hH?'"6
..Q/@A 7 RL//0AB''!6 ''(9:w)(
 	
W @ W W* @s   H	H'H*Hc                (    V P                   ! W3/ VB # r   )rl   )r2   ro   r^   extra_contexts   &&&,r    	as_sqliteIndexExpression.as_sqlite  s    {{8A=AAr;   r   r   )NTNFF)r   r   r   r   __doc__r   r   r   r   rz   classmethodr   r{   r   r   r   __classcell__)r   r   s   @@r    ry   ry   3  sB     A H(O	 . .;
zB Br;   ry   N)typesr   django.corer   django.db.backends.utilsr   r   django.db.models.expressionsr   r   r	   r
   r   django.db.models.functionsr   django.db.models.query_utilsr   django.db.models.sqlr   django.utils.functionalr   __all__r   ry   r(   r;   r    <module>r      sD      C N N . * & -)b bJ	TBd TBr;   