https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/db/migrations/operations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/db/migrations/operations/__pycache__/base.cpython-310.pyc
o

�a��@sddlmZGdd�d�ZdS)�)�routerc@s�eZdZdZdZdZdZdZgZdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zedd��Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�	Operationa)
    Base class for migration operations.

    It's responsible for both mutating the in-memory model state
    (see db/migrations/state.py) to represent what it performs, as well
    as actually performing it against a live database.

    Note that some operations won't modify memory state at all (e.g. data
    copying operations), and some will need their modifications to be
    optionally specified by the user (e.g. custom Python code snippets)

    Due to the way this class deals with deconstruction, it should be
    considered immutable.
    TFcOst�|�}||f|_|S)N)�object�__new__�_constructor_args)�cls�args�kwargs�self�r�F/usr/lib/python3/dist-packages/django/db/migrations/operations/base.pyr$s

zOperation.__new__cCs|jj|jd|jdfS)z�
        Return a 3-tuple of class import path (or just name if it lives
        under django.db.migrations), positional arguments, and keyword
        arguments.
        r���	__class__�__name__r�r
rrr�deconstruct*s�zOperation.deconstructcC�td��)z�
        Take the state from the previous migration, and mutate it
        so that it matches what this migration would perform.
        z>subclasses of Operation must provide a state_forwards() method��NotImplementedError)r
�	app_label�staterrr�state_forwards6�zOperation.state_forwardscCr)zi
        Perform the mutation on the database schema in the normal
        (forwards) direction.
        zAsubclasses of Operation must provide a database_forwards() methodr�r
r�
schema_editor�
from_state�to_staterrr�database_forwards=rzOperation.database_forwardscCr)z�
        Perform the mutation on the database schema in the reverse
        direction - e.g. if this were CreateModel, it would in fact
        drop the model's table.
        zBsubclasses of Operation must provide a database_backwards() methodrrrrr�database_backwardsDszOperation.database_backwardscCsd|jj|jfS)zA
        Output a brief summary of what the action does.
        z%s: %srrrrr�describeLszOperation.describecC�dS)z�
        A filename part suitable for automatically naming a migration
        containing this operation, or None if not applicable.
        Nrrrrr�migration_name_fragmentRsz!Operation.migration_name_fragmentcCr!)a�
        Return True if there is a chance this operation references the given
        model name (as a string), with an app label for accuracy.

        Used for optimization. If in doubt, return True;
        returning a false positive will merely make the optimizer a little
        less efficient, while returning a false negative may result in an
        unusable optimized migration.
        Tr)r
�namerrrr�references_modelZs
zOperation.references_modelcCs|�||�S)z�
        Return True if there is a chance this operation references the given
        field name, with an app label for accuracy.

        Used for optimization. If in doubt, return True.
        )r$)r
�
model_namer#rrrr�references_fieldfszOperation.references_fieldcCs|j�|�sdSt�||�S)z�
        Return whether or not a model may be migrated.

        This is a thin wrapper around router.allow_migrate_model() that
        preemptively rejects any proxy, swapped out, or unmanaged model.
        F)�_meta�can_migrater�allow_migrate_model)r
�connection_alias�modelrrrr)oszOperation.allow_migrate_modelcCs|jr|gS|jr|gSdS)z�
        Return either a list of operations the actual operation should be
        replaced with or a boolean that indicates whether or not the specified
        operation can be optimized across.
        F)�elidable)r
�	operationrrrr�reduce{s
zOperation.reducecCs>d|jjd�tt|jd��d�dd�|jd��D��fS)Nz	<%s %s%s>z, r�,css�|]}d|VqdS)z %s=%rNr)�.0�xrrr�	<genexpr>�s�z%Operation.__repr__.<locals>.<genexpr>r
)rr�join�map�reprr�itemsrrrr�__repr__�s
�zOperation.__repr__N)r�
__module__�__qualname__�__doc__�
reversible�reduces_to_sql�atomicr,�serialization_expand_argsrrrrrr �propertyr"r$r&r)r.r7rrrrrs(
	rN)�	django.dbrrrrrr�<module>s

https://t.me/RX1948 - 2025