Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/sqlalchemy/orm/__pycache__/properties.cpython-39.pyc
Ðазад
a _�h�1 � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ dgZ e jG d d� de��ZdS )z|MapperProperty implementations. This is a private module which defines the behavior of individual ORM- mapped attributes. � )�absolute_import� )� attributes)�PropComparator)�StrategizedProperty)�_orm_full_deannotate� )�log)�util�� expression�ColumnPropertyc s� e Zd ZdZdZdZejdd�� fdd��Ze� dd �d d� �Z dd � Zedd� �Z dd� Z� fdd�Zdd� Zejfdd�Zdd� ZG dd� deje�Zdd� Z� ZS )r z�Describes an object attribute that corresponds to a table column. Public constructor is the :func:`_orm.column_property` function. �column)� _orig_columns�columns�group�deferred� instrument�comparator_factory� descriptor� extension�active_history�expire_on_flush�info�doc�strategy_keyZ_creation_orderZ_is_polymorphic_discriminatorZ_mapped_by_synonymZ_deferred_column_loader)z0.7z�:class:`.AttributeExtension` is deprecated in favor of the :class:`.AttributeEvents` listener interface. The :paramref:`.column_property.extension` parameter will be removed in a future release.)r c sN t t| ��� dd� |D �| _dd� |D �| _|�dd�| _|�dd�| _|�dd �| _|�d | j j �| _|�dd�| _|�dd�| _ |�d d�| _|�dd �| _d|v r�|�d�| _d|v r�|�d�| _n6t| j�D ]$}t|dd�}|dur�|| _ �qq�d| _|�r*td| j jd�t|�� ��f ��t�| � d| jfd| jff| _dS )a� Provide a column-level property for use with a mapping. Column-based properties can normally be applied to the mapper's ``properties`` dictionary using the :class:`_schema.Column` element directly. Use this function when the given column is not directly present within the mapper's selectable; examples include SQL expressions, functions, and scalar SELECT queries. The :func:`_orm.column_property` function returns an instance of :class:`.ColumnProperty`. Columns that aren't present in the mapper's selectable won't be persisted by the mapper and are effectively "read-only" attributes. :param \*cols: list of Column objects to be mapped. :param active_history=False: When ``True``, indicates that the "previous" value for a scalar attribute should be loaded when replaced, if not already loaded. Normally, history tracking logic for simple non-primary-key scalar values only needs to be aware of the "new" value in order to perform a flush. This flag is available for applications that make use of :func:`.attributes.get_history` or :meth:`.Session.is_modified` which also need to know the "previous" value of the attribute. :param comparator_factory: a class which extends :class:`.ColumnProperty.Comparator` which provides custom SQL clause generation for comparison operations. :param group: a group name for this property when marked as deferred. :param deferred: when True, the column property is "deferred", meaning that it does not load immediately, and is instead loaded when the attribute is first accessed on an instance. See also :func:`~sqlalchemy.orm.deferred`. :param doc: optional string that will be applied as the doc on the class-bound descriptor. :param expire_on_flush=True: Disable expiry on flush. A column_property() which refers to a SQL expression (and not a single table-bound column) is considered to be a "read only" property; populating it has no effect on the state of data, and it can only return database state. For this reason a column_property()'s value is expired whenever the parent object is involved in a flush, that is, has any kind of "dirty" state within a flush. Setting this parameter to ``False`` will have the effect of leaving any existing value present after the flush proceeds. Note however that the :class:`.Session` with default expiration settings still expires all attributes after a :meth:`.Session.commit` call, however. :param info: Optional data dictionary which will be populated into the :attr:`.MapperProperty.info` attribute of this object. :param extension: an :class:`.AttributeExtension` instance, or list of extensions, which will be prepended to the list of attribute listeners for the resulting descriptor placed on the class. .. seealso:: :ref:`column_property_options` - to map columns while including mapping options :ref:`mapper_column_property_sql_expressions` - to map SQL expressions c S s g | ]}t �|��qS � )r �_labeled��.0�cr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/sqlalchemy/orm/properties.py� <listcomp>� � z+ColumnProperty.__init__.<locals>.<listcomp>c S s g | ]}t �t|���qS r )r r r r r r r! r"