HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyc
�
���ec@@s�dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
dd	l	mZdd
lm
Z
ddlmZdd
lmZddlmZddlmZdddddgZejdefd��Y�ZdS(s|MapperProperty implementations.

This is a private module which defines the behavior of individual ORM-
mapped attributes.

i(tabsolute_importi(t
attributes(tCompositeProperty(tConcreteInheritedProperty(tSynonymProperty(tPropComparator(tStrategizedProperty(tRelationshipPropertyi(tlog(tutil(t	coercions(trolestColumnPropertyRRRRcB@s�eZdZdZeZeZd$Zd�Z	d�Z
ejdd�d��Z
ejdd�d��Zd�Zed��Zd�Zd�Zd�Zejd�Zd �Zd!ejefd"��YZd#�ZRS(%s�Describes an object attribute that corresponds to a table column.

    Public constructor is the :func:`_orm.column_property` function.

    tcolumntcolumnstgrouptdeferredt
instrumenttcomparator_factoryt
descriptortactive_historytexpire_on_flushtinfotdoctstrategy_keyt_creation_ordert_is_polymorphic_discriminatort_mapped_by_synonymt_deferred_column_loadert_raise_column_loadert_renders_in_subqueriest	raiseloadcO@stt|�j�g|D]}tjtj|�^q|_|jdd�|_
|jdt�|_|jdt�|_
|jdt�|_|jd|jj�|_|jdd�|_|jdt�|_|jdt�|_d	|kr
|jd	�|_nd
|kr.|jd
�|_nNxKt|j�D]1}t|d
d�}|dk	r>||_Pq>q>Wd|_|r�td|jjdjt|j���f��ntj |�d|jfd
|jff|_!|j
r|j!dtff7_!ndS(s4Provide 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 raiseload: if True, indicates the column should raise an error
            when undeferred, rather than loading the value.  This can be
            altered at query time by using the :func:`.deferred` option with
            raiseload=False.

            .. versionadded:: 1.4

            .. seealso::

                :ref:`deferred_raiseload`

        .. seealso::

            :ref:`column_property_options` - to map columns while including
            mapping options

            :ref:`mapper_column_property_sql_expressions` - to map SQL
            expressions

        RRRt_instrumentRRRRRRs.%s received unexpected keyword argument(s): %ss, RN("tsuperRt__init__R
texpectRtLabeledColumnExprRoleRtpoptNoneRtFalseRRtTrueRt	__class__t
ComparatorRRRRRRtreversedtgetattrt	TypeErrort__name__tjointsortedtkeysR	tset_creation_orderR(tselfRtkwargstctcolR((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyR"Gs<T+		.
	cC@sDdtf|jkr|jjSdtf|jkpC||jjkS(Ntquery_expressionR(R(Rtstrategyt_have_default_expressiontparentt_readonly_props(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt%_memoized_attr__renders_in_subqueries�s
ssqlalchemy.orm.statessqlalchemy.orm.strategiescC@sCtjj}tjj}|jj|jj|j|j	�|j	�S(N(
R	t	preloadedt	orm_statetorm_strategiest
InstanceStatet"_instance_level_callable_processorR:t
class_managertLoadDeferredColumnstkey(R3tstatet
strategies((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt&_memoized_attr__deferred_column_loader�s		cC@sFtjj}tjj}|jj|jj|j|j	t
�|j	�S(N(R	R=R>R?R@RAR:RBRCRDR((R3RERF((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt#_memoized_attr__raise_column_loader�s		cC@s|jS(ssAllow the ColumnProperty to work in expression before it is turned
        into an instrumented attribute.
        (t
expression(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt__clause_element__�scC@s|jdS(s�Return the primary column or expression for this ColumnProperty.

        E.g.::


            class File(Base):
                # ...

                name = Column(String(64))
                extension = Column(String(8))
                filename = column_property(name + '.' + extension)
                path = column_property('C:/' + filename.expression)

        .. seealso::

            :ref:`mapper_column_property_sql_expressions_composed`

        i(R(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyRI�sc	C@sH|js
dStj|j|jd|j||�d|d|j�dS(Nt
comparatortparententityR(RRtregister_descriptortclass_RDRR(R3tmapper((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pytinstrument_classs		cC@s~tt|�j�t|j�dkrzt|jj�j|j�rzt	j
d|j|jd|jd|jf�ndS(Nis�On mapper %s, primary key column '%s' is being combined with distinct primary key column '%s' in attribute '%s'. Use explicit properties to give each column its own mapped attribute name.i(R!Rtdo_inittlenRtsetR:tprimary_keyt
issupersetR	twarnRD(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyRQs'cC@s(td|jd|jd|j|j�S(NRRR(RRRRR(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pytcopys
		cC@s"|j|j�j||d|�S(Ntpassive(tget_implRDtget_committed_value(R3REtdict_R
RX((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt
_getcommitted$sc	C@s�|js
dS|j|krj||j}	|s?|	||j<q�|j|j�}
|
j|||	d�n7|jr�|j|kr�|j||jgdt�ndS(Nt	no_loader(RRDRYRSR&thas_identityt_expire_attributesR((R3tsessiontsource_statetsource_dictt
dest_statet	dest_dicttloadt
_recursivet_resolve_conflict_maptvaluetimpl((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pytmerge+s	
R*cB@sSeZdZdZd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
RS(s�Produce boolean, comparison, and other operators for
        :class:`.ColumnProperty` attributes.

        See the documentation for :class:`.PropComparator` for a brief
        overview.

        .. seealso::

            :class:`.PropComparator`

            :class:`.ColumnOperators`

            :ref:`types_operators`

            :attr:`.TypeEngine.comparator_factory`

        RJRtexpressionscC@s�|j}i|d6|d6|d6|jjd6}|}|jjrk|}|jjj|�}||d<n|j|�jidd6|d6�S(	s�annotate and possibly adapt a column to be returned
            as the mapped-attribute exposed version of the column.

            The column in this context needs to act as much like the
            column in an ORM mapped context as possible, so includes
            annotations to give hints to various ORM functions as to
            the source entity of this column.   It also adapts it
            to the mapper's with_polymorphic selectable if one is
            present.

            tentity_namespaceRLtparentmappert	proxy_keytadapt_columntormtcompile_state_plugintplugin_subject(t
_parententitytpropRDt
_parentmappert_polymorphic_adapterttraverset	_annotatet_set_propagate_attrs(R3R
tpetannotationsR6tmapper_local_col((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt_orm_annotate_columnZs
	
cC@sD|jr)|j|jjd|jj�S|j|jjd�SdS(Ni(tadapterRtRRDR}(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt#_memoized_method___clause_element__�s	 cC@s6|j�}y|jSWntk
r1|jjSXdS(s(The .info dictionary for this attribute.N(RJRtAttributeErrorRt(R3tce((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt_memoized_attr_info�s

cC@sb|jr8g|jjD]}|j||jj�^qSg|jjD]}|j|�^qESdS(s�The full sequence of columns referenced by this
            attribute, adjusted for any aliasing in progress.

            .. versionadded:: 1.3.17

            N(R~RtRRDR}(R3R6((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt_memoized_attr_expressions�s	,cC@st|j�|�S(s�proxy attribute access down to the mapped column.

            this allows user-defined comparison methods to be accessed.
            (R,RJ(R3RD((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt_fallback_getattr�scO@s||j�||�S(N(RJ(R3toptotherR4((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pytoperate�scK@s(|j�}||j||�||�S(N(RJt_bind_param(R3R�R�R4R6((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pytreverse_operate�s(RJRRk(R.t
__module__t__doc__t	__slots__R}RR�R�R�R�R�(((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyR*Es	(						cC@st|jjj�d|jS(Nt.(tstrR:RNR.RD(R3((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt__str__�s(RRRRRRRRRRRRRRRRRR(R.R�R�tstrategy_wildcard_keyR(t
inherit_cacheR't_links_to_entityR�R"R<R	tpreload_moduleRGRHRJtpropertyRIRPRQRWRtPASSIVE_OFFR\Rjt
MemoizedSlotsRR*R�(((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyR&sF	�	

						kN(R�t
__future__RtRtdescriptor_propsRRRt
interfacesRRt
relationshipsRRR	tsqlR
Rt__all__tclass_loggerR(((sJ/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/orm/properties.pyt<module>
s&