+
    Tj                         ^ RI t ^ RIHt ^ RIHtHtHt ^ RIHt ^ RI	H
t
HtHtHt ^ RIHt ^ RIHt  ! R R	]4      tR# )
    N)sync_to_async)CreateErrorSessionBaseUpdateError)SuspiciousOperation)DatabaseErrorIntegrityErrorroutertransaction)timezone)cached_propertyc                      a a ] tR t^t oRtRV 3R llt]R 4       t]R 4       t	R t
R tR tR tR	 tR
 tR tR tR tR tRR ltRR ltRR ltRR lt]R 4       t]R 4       tRtVtV ;t# )SessionStorez#
Implement database session store.
c                &   < \         SV `  V4       R # N)super__init__)selfsession_key	__class__s   &&X/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/sessions/backends/db.pyr   SessionStore.__init__   s    %    c                    ^ RI Hp V# )r   )Session)django.contrib.sessions.modelsr   )clsr   s   & r   get_model_classSessionStore.get_model_class   s     	;r   c                "    V P                  4       # r   )r   r   s   &r   modelSessionStore.model   s    ##%%r   c                    V P                   P                  P                  V P                  \        P
                  ! 4       R 7      #   T P                   P                  \        3 dt   p\        T\        4      '       dL   \        P                  ! RTP                  P                  ,          4      pTP                  \        T4      4       RT n         Rp?R# Rp?ii ; i)r   expire_date__gtdjango.security.%sN)r"   objectsgetr   r   nowDoesNotExistr   
isinstancelogging	getLoggerr   __name__warningstr_session_keyr   eloggers   &  r   _get_session_from_db!SessionStore._get_session_from_db    s    	%::%%)) ,,hlln *   

'')<= 	%!011 **+?!++BVBV+VWs1v& $D		%s   AA !C'A(CCc                  "    V P                   P                  P                  V P                  \        P
                  ! 4       R 7      G Rj  xL
 #  L  T P                   P                  \        3 dt   p\        T\        4      '       dL   \        P                  ! RTP                  P                  ,          4      pTP                  \        T4      4       RT n         Rp?R# Rp?ii ; i5i)r%   Nr'   )r"   r(   agetr   r   r*   r+   r   r,   r-   r.   r   r/   r0   r1   r2   r3   s   &  r   _aget_session_from_db"SessionStore._aget_session_from_db+   s     	%++00 ,,hlln 1     

'')<= 	%!011 **+?!++BVBV+VWs1v& $D		%sB   C)AA AA C)A !C&3A(C!C)!C&&C)c                l    V P                  4       pV'       d   V P                  VP                  4      # / # r   )r6   decodesession_datar   ss   & r   loadSessionStore.load6   s*    %%'./t{{1>>*7R7r   c                   "   V P                  4       G R j  xL
 pV'       d   V P                  VP                  4      # / #  L)5ir   )r:   r=   r>   r?   s   & r   aloadSessionStore.aload:   s5     ,,.../t{{1>>*7R7 /s   AA AAc                j    V P                   P                  P                  VR 7      P                  4       # )r   )r"   r(   filterexistsr   r   s   &&r   rI   SessionStore.exists>   s)    zz!!(([(AHHJJr   c                   "   V P                   P                  P                  VR 7      P                  4       G Rj  xL
 #  L5i)rG   N)r"   r(   rH   aexistsrJ   s   &&r   rM   SessionStore.aexistsA   s2     ZZ''..;.GOOQQQQs   8A?Ac                     V P                  4       V n         V P                  R R7       R T n        R#   \         d     K@  i ; i)Tmust_createN)_get_new_session_keyr2   saver   modifiedr!   s   &r   createSessionStore.createD   sK     $ 9 9 ;D 		d	+ !DM	  s   3 AAc                   "    V P                  4       G Rj  xL
 V n         V P                  R R7      G Rj  xL
  R T n        R#  L- L  \         d     KT  i ; i5i)TNrP   )_aget_new_session_keyr2   asaver   rT   r!   s   &r   acreateSessionStore.acreateQ   s_     &*&@&@&B BD jjTj222 !DM !C 3 sA   AA	AA	 AA	 
AA	 	AAAAc                    V P                  V P                  4       V P                  V4      V P                  4       R7      # )z
Return a new instance of the session model object, which represents the
current session state. Intended to be used for saving the session data
to the database.
r   r>   expire_date)r"   _get_or_create_session_keyencodeget_expiry_dater   datas   &&r   create_model_instance"SessionStore.create_model_instance^   s>     zz779T*,,.  
 	
r   c                   "   T P                  V P                  4       G Rj  xL
 V P                  V4      V P                  4       G Rj  xL
 R7      #  L0 L5i)zSee create_model_instance().Nr]   )r"   _aget_or_create_session_keyr`   aget_expiry_daterb   s   &&r   acreate_model_instance#SessionStore.acreate_model_instancej   sK     zz">>@@T*"3355  
 	
@5s!   AA&AA	
AAc                   V P                   f   V P                  4       # V P                  VR7      pV P                  V4      p\        P
                  ! V P                  VR7      p \        P                  ! VR7      ;_uu_ 4        VP                  W'       * VR7       RRR4       R#   + '       g   i     R# ; i  \         d    T'       d   \        hh \         d    T'       g   \        hh i ; i)z
Save the current session data to the database. If 'must_create' is
True, raise a database error if the saving operation doesn't create a
new entry (as opposed to possibly updating an existing entry).
Nno_loadinstanceusingforce_insertforce_updaterq   )r   rU   _get_sessionrd   r
   db_for_writer"   r   atomicrS   r	   r   r   r   )r   rQ   rc   objrq   s   &&   r   rS   SessionStore.saver   s     #;;=    5((.##DJJ=	##%00!,?RW   1000  	!! 	!!	s<   %B; B'B; 'B8	2B; 8B; ;C/C/C/'C/c                  aaa"   V P                   f   V P                  4       G Rj  xL
 # V P                  SR7      G Rj  xL
 pV P                  V4      G Rj  xL
 o\        P
                  ! V P                  SR7      o \        VVV3R l4       pV! 4       G Rj  xL
  R#  L| Ld LM L  \         d    S'       d   \        hh \         d    S'       g   \        hh i ; i5i)zSee save().Nrl   rn   c                     < \         P                  ! SR 7      ;_uu_ 4        SP                  S S '       * SR7       RRR4       R#   + '       g   i     R# ; i)rp   rr   N)r   rw   rS   )rQ   rx   rq   s   r   sync_transaction,SessionStore.asave.<locals>.sync_transaction   s?     ''e44HH%0)4_#   5444s   AA	)r   rZ   _aget_sessionri   r
   rv   r"   r   r	   r   r   r   )r   rQ   rc   r|   rx   rq   s   &f  @@r   rY   SessionStore.asave   s     #'''''<<//55##DJJ=	   #$$$# (<5 % 	!! 	!!	so   "C#B$C#B&C#B(&C#B, B*B, "C#&C#(C#*B, ,C ?C C C  C#c                    Vf   V P                   f   R # V P                   p V P                  P                  P                  VR7      P	                  4        R #   T P                  P
                   d     R # i ; iNrG   )r   r"   r(   r)   deleter+   rJ   s   &&r   r   SessionStore.delete   sg    '**K	JJ""{";BBDzz&& 		s   4A A76A7c                (  "   Vf   V P                   f   R # V P                   p V P                  P                  P                  VR7      G R j  xL
 pVP	                  4       G R j  xL
  R #  L L  T P                  P
                   d     R # i ; i5ir   )r   r"   r(   r9   adeleter+   )r   r   rx   s   && r   r   SessionStore.adelete   s}     '**K	

**//K/HHC++- Izz&& 		sL   !B)A0 A,A0 %A.&A0 *B,A0 .A0 0BBBBc                    V P                  4       P                  P                  \        P                  ! 4       R 7      P                  4        R# )expire_date__ltN)r   r(   rH   r   r*   r   r   s   &r   clear_expiredSessionStore.clear_expired   s1    %%,,X\\^,LSSUr   c                   "   V P                  4       P                  P                  \        P                  ! 4       R 7      P                  4       G Rj  xL
  R#  L5ir   )r   r(   rH   r   r*   r   r   s   &r   aclear_expiredSessionStore.aclear_expired   sA     !!#++22$LLN 3 

')	 	s   AAAA)r2   rT   r   )F)r/   
__module____qualname____firstlineno____doc__r   classmethodr   r   r"   r6   r:   rA   rD   rI   rM   rU   rZ   rd   ri   rS   rY   r   r   r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r   r      s     &   & &	%	%88KR


2<	 V V   r   r   )r-   asgiref.syncr   %django.contrib.sessions.backends.baser   r   r   django.core.exceptionsr   	django.dbr   r	   r
   r   django.utilsr   django.utils.functionalr   r    r   r   <module>r      s.     & W W 6 H H ! 3z; zr   