Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
‹EYc	@sSddlmZmZmZmZmZddlmZmZm	Z	ddl
mZmZddlm
Z
ddlZddlmZmZmZmZmZmZmZmZmZdd	lmZmZdd
lmZddlmZed/ƒZdefd„ƒYZ d„Z!de"d„Z#d„Z$dej%fd„ƒYZ&de'fd„ƒYZ(defd„ƒYZ)ej*e(ƒd „ƒej*e)ƒd!„ƒdde,e,d"„Z-e,e,de,e,e,dd#„Z.dd$„Z/d%„Z0d&„Z1d'ej2fd(„ƒYZ3de,dd)„Z4ddd*„Z5d+„Z6d,„Z7d-„Z8d.„Z9dS(0i(tsqltutilteventtexct
inspection(t
expressionRt	operatorsi(tPropComparatortMapperProperty(t
attributesiÿÿÿÿN(	tinstance_strt	state_strtstate_class_strt
attribute_strtstate_attribute_strt
object_mappertobject_statet	_none_sett
_never_set(tclass_mappert_class_to_mapper(tInspectionAttr(tPathRegistrytdeletes
delete-orphantalltmergetexpungessave-updatesrefresh-expiretnonetCascadeOptionscBsSeZdZejdddgƒZeZd
Zd
„Zd„Z	e
d„ƒZRS(s9Keeps track of the options sent to relationship().cascadeRRs
delete-orphantsave_updateRtrefresh_expireRRt
delete_orphancCskt|tjƒs|dkr+|j|ƒSt|ƒ}|j|jƒr“tj	ddj
gt|j|jƒƒD]}t|ƒ^qqƒƒ‚nd|kr²|j
|jƒnd|krË|jƒn|jdƒtjt|ƒ}d|k|_d|k|_d|k|_d|k|_d	|k|_d
|k|_|jrg|jrgtjdƒn|S(NsInvalid cascade option(s): %ss, RRssave-updateRsrefresh-expireRRs
delete-orphans5The 'delete-orphan' cascade option requires 'delete'.(t
isinstanceRtstring_typestNonetfrom_stringtsett
differencet_allowed_cascadestsa_exct
ArgumentErrortjointsortedtreprtupdatet_add_w_all_cascadestcleartdiscardt	frozensett__new__RRRRRRRtwarn(tclst
value_listtvaluestxtself((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR1%s.
	8

cCs*ddjgt|ƒD]}|^qƒS(NsCascadeOptions(%r)t,(R)R*(R7R6((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt__repr__BscCs;gtjd|pdƒD]}|r|^q}||ƒS(Ns\s*,\s*t(tretsplit(R3targtcR5((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR#Gs(ssave_updatesdeletesrefresh_expiresmergesexpunges
delete_orphan(t__name__t
__module__t__doc__tall_cascadesR%R-R&t	__slots__R1R9tclassmethodR#(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRs		csˆs‡fd†‰n|ri‡‡‡‡fd†}‡‡‡‡fd†}‡‡‡‡fd†}n0‡‡‡‡fd†}‡‡‡‡fd†}tj|d|dtd	tƒtj|d
|dtd	tƒ|rÿtj|d|dtd	tƒndS(
sNRuns a validation method on an attribute value to be set or
    appended.
    cs|jˆj}|j|k	S(N(tmanagertimpl(tstatet	initiatorRF(tkey(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytdetect_is_backrefXscs7ˆsˆ||ƒr/ˆ|jƒˆ|tƒS|SdS(N(tobjtFalse(RGtvalueRH(RJtinclude_backrefsRIt	validator(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytappend]scs7ˆsˆ||ƒr/ˆ|jƒˆ|tƒS|SdS(N(RKRL(RGRMtoldvalueRH(RJRNRIRO(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytset_cscs6ˆsˆ||ƒr2ˆ|jƒˆ|tƒndS(N(RKtTrue(RGRMRH(RJRNRIRO(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytremoveiscs4ˆsˆ||ƒr,ˆ|jƒˆ|ƒS|SdS(N(RK(RGRMRH(RJRNRIRO(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRPnscs4ˆsˆ||ƒr,ˆ|jƒˆ|ƒS|SdS(N(RK(RGRMRQRH(RJRNRIRO(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRRtsRPtrawtretvalR$RTN(RtlistenRS(tdescRIROtinclude_removesRNRPRRRT((RJRNRIROsH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_validator_eventsQstp_unionc
s¤tjƒ}i‰i‰x”|D]Œ}||}t|tjƒrZ|jƒ}|||<ni}x>|jD]3}|j|jƒ|||j<|j	ˆ|j<qjW|ˆ|<qW‡‡‡fd†}	g}
xÁ|j
ƒD]³\}}|dk	rO|
jtj
g|D]}|	||ƒ^qtjtj|ƒƒj|ƒgd|gƒƒq×|
jtj
g|D]}|	||ƒ^qbd|gƒƒq×Wtj|
Œj|ƒS(s)Create a ``UNION`` statement used by a polymorphic mapper.

    See  :ref:`concrete_inheritance` for an example of how
    this is used.

    :param table_map: mapping of polymorphic identities to
     :class:`.Table` objects.
    :param typecolname: string name of a "discriminator" column, which will be
     derived from the query, producing the polymorphic identity for
     each row.  If ``None``, no polymorphic discriminator is generated.
    :param aliasname: name of the :func:`~sqlalchemy.sql.expression.alias()`
     construct generated.
    :param cast_nulls: if True, non-existent columns, which are represented
     as labeled NULLs, will be passed into CAST.   This is a legacy behavior
     that is problematic on some backends such as Oracle - in which case it
     can be set to False.

    cstyˆ||SWn]tk
roˆrItjtjƒˆ|ƒj|ƒStjtjƒˆ|ƒj|ƒSnXdS(N(tKeyErrorRtcasttnulltlabelttype_coerce(tnamettable(t
cast_nullstcolnamemapsttypes(sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytcol¨s
#tfrom_objN(Rt
OrderedSetR RtSelecttaliasR>taddRIttypetitemsR"RPtselecttliteral_columntsql_utilt_quote_ddl_exprR_t	union_all(
t	table_mapttypecolnamet	aliasnameRctcolnamesRIRbtmR>RftresultRlRa((RcRdResH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytpolymorphic_union€s6



	%
.cOsi|rt|ƒdkr[|d}y|jdƒ}Wq¶tk
rW|jdƒ}q¶Xn[t|ƒdkr||\}}n:t|ƒdkr|\}}ntjdt|ƒƒ‚|rÛtjdd	j|ƒƒ‚nt|ƒ}dtƒkr|jt	j
|ƒƒS|j|ƒS|jd
ƒ}|rPtjdd	j|jƒƒ‚nt
|ƒ}|j|ƒS(sGenerate "identity key" tuples, as are used as keys in the
    :attr:`.Session.identity_map` dictionary.

    This function has several call styles:

    * ``identity_key(class, ident)``

      This form receives a mapped class and a primary key scalar or
      tuple as an argument.

      E.g.::

        >>> identity_key(MyClass, (1, 2))
        (<class '__main__.MyClass'>, (1, 2))

      :param class: mapped class (must be a positional argument)
      :param ident: primary key, may be a scalar or tuple argument.


    * ``identity_key(instance=instance)``

      This form will produce the identity key for a given instance.  The
      instance need not be persistent, only that its primary key attributes
      are populated (else the key will contain ``None`` for those missing
      values).

      E.g.::

        >>> instance = MyClass(1, 2)
        >>> identity_key(instance=instance)
        (<class '__main__.MyClass'>, (1, 2))

      In this form, the given instance is ultimately run though
      :meth:`.Mapper.identity_key_from_instance`, which will have the
      effect of performing a database check for the corresponding row
      if the object is expired.

      :param instance: object instance (must be given as a keyword arg)

    * ``identity_key(class, row=row)``

      This form is similar to the class/tuple form, except is passed a
      database result row as a :class:`.RowProxy` object.

      E.g.::

        >>> row = engine.execute("select * from table where a=1 and b=2").first()
        >>> identity_key(MyClass, row=row)
        (<class '__main__.MyClass'>, (1, 2))

      :param class: mapped class (must be a positional argument)
      :param row: :class:`.RowProxy` row returned by a :class:`.ResultProxy`
       (must be given as a keyword arg)

    iitrowtidentiis1expected up to three positional arguments, got %ssunknown keyword arguments: %ss, tinstance(tlentpopR\R'R(R)Rtlocalstidentity_key_from_primary_keyRtto_listtidentity_key_from_rowtkeysRtidentity_key_from_instance(targstkwargstclass_RzR{tmapperR|((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytidentity_keyÀs69

	
	t
ORMAdaptercBs/eZdZdedeed„Zd„ZRS(saColumnAdapter subclass which excludes adaptation of entities from
    non-matching mappers.

    c

Cs€tj|ƒ}|j|_|j}|j}	|	r?||_n	d|_tjj	||||d|d|d|d|j
ƒdS(Ntadapt_requiredtallow_label_resolvetanonymize_labelst
include_fn(RtinspectRˆt
selectabletis_aliased_classt
aliased_classR"Rpt
ColumnAdaptert__init__t_include_fn(
R7tentitytequivalentsR‹tchain_toRŒRtinfoRR‘((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR”s				cCs,|jjddƒ}|p+|j|jƒS(Ntparentmapper(t_annotationstgetR"tisaRˆ(R7telemR–((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR•2sN(R?R@RAR"RLRSR”R•(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRŠs
tAliasedClassc	BsAeZdZddeeddded„Zd„Zd„ZRS(sRepresents an "aliased" form of a mapped class for usage with Query.

    The ORM equivalent of a :func:`sqlalchemy.sql.expression.alias`
    construct, this object mimics the mapped class using a
    __getattr__ scheme and maintains a reference to a
    real :class:`~sqlalchemy.sql.expression.Alias` object.

    Usage is via the :func:`.orm.aliased` function, or alternatively
    via the :func:`.orm.with_polymorphic` function.

    Usage example::

        # find all pairs of users with the same name
        user_alias = aliased(User)
        session.query(User, user_alias).\
                        join((user_alias, User.id > user_alias.id)).\
                        filter(User.name==user_alias.name)

    The resulting object is an instance of :class:`.AliasedClass`.
    This object implements an attribute scheme which produces the
    same attribute and method interface as the original mapped
    class, allowing :class:`.AliasedClass` to be compatible
    with any attribute technique which works on the original class,
    including hybrid attributes (see :ref:`hybrids_toplevel`).

    The :class:`.AliasedClass` can be inspected for its underlying
    :class:`.Mapper`, aliased selectable, and other information
    using :func:`.inspect`::

        from sqlalchemy import inspect
        my_alias = aliased(MyClass)
        insp = inspect(my_alias)

    The resulting inspection object is an instance of :class:`.AliasedInsp`.

    See :func:`.aliased` and :func:`.with_polymorphic` for construction
    argument descriptions.

    c

Cs˜t|ƒ}
|dkr6|
jjd|d|ƒ}nt||
|||rQ|n|
j|dk	ri|n|
j||	|ƒ	|_d|
jj	|_	dS(NRatflatsAliasedClass_%s(
RR"t_with_polymorphic_selectableRjtAliasedInsptwith_polymorphic_mapperstpolymorphic_ont
_aliased_inspR‡R?(R7R3RjRaR tadapt_on_namesR£twith_polymorphic_discriminatort
base_aliastuse_mapper_pathRˆ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR”`s"	cCsVy|jd}Wntk
r-tƒ‚nRXxN|jjD]4}ytj||ƒ}Wntk
rmq;q;XPq;Wt|ƒ‚t|tƒr±|j	|ƒ}t
|||ƒ|St|dƒr
t|j|dƒ}|r|jdk	rtjj|j||ƒSdSnHt|dƒrN|jd|ƒ}t|tƒrG|j	|ƒS|Sn|SdS(NR¥t	func_codet__get__(t__dict__R\tAttributeErrort_targett__mro__tobjectt__getattribute__R Rtadapt_to_entitytsetattrthasattrtgetattrR"t__self__RRet
MethodTypet__func__R«(R7RIR¥tbasetattrtrett	is_method((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt__getattr__€s4



cCsdt|ƒ|jjjfS(Ns<AliasedClass at 0x%x; %s>(tidR¥R®R?(R7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR9£sN((R?R@RAR"RLR”R½R9(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRŸ7s'	#R¢cBskeZdZd„ZeZed„ƒZej	d„ƒZ
d„Zd„Zd„Z
d„Zd„ZRS(	s»Provide an inspection interface for an
    :class:`.AliasedClass` object.

    The :class:`.AliasedInsp` object is returned
    given an :class:`.AliasedClass` using the
    :func:`.inspect` function::

        from sqlalchemy import inspect
        from sqlalchemy.orm import aliased

        my_alias = aliased(MyMappedClass)
        insp = inspect(my_alias)

    Attributes on :class:`.AliasedInsp`
    include:

    * ``entity`` - the :class:`.AliasedClass` represented.
    * ``mapper`` - the :class:`.Mapper` mapping the underlying class.
    * ``selectable`` - the :class:`.Alias` construct which ultimately
      represents an aliased :class:`.Table` or :class:`.Select`
      construct.
    * ``name`` - the name of the alias.  Also is used as the attribute
      name when returned in a result tuple from :class:`.Query`.
    * ``with_polymorphic_mappers`` - collection of :class:`.Mapper` objects
      indicating all those mappers expressed in the select construct
      for the :class:`.AliasedClass`.
    * ``polymorphic_on`` - an alternate column or SQL expression which
      will be used as the "discriminator" for a polymorphic load.

    .. seealso::

        :ref:`inspection_toplevel`

    c
Csè||_||_||_||_||_||_|p?||_||_tj	|d|j
d|	dtƒ|_|	|_
|j|_xW|jD]L}
|
|k	r”t|j|
jjt|
j|d|d|	d|ƒƒq”q”WdS(NR—R¦RR¨R©(R–RˆRRaR£R¤t_base_aliast_use_mapper_pathRpR“t_equivalent_columnsRSt_adaptert_adapt_on_namesR‡R®R³R?RŸ(R7R–RˆRRaR£R¤R¿RÀR¦tpoly((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR”Ìs&								cCs
|jjS(sUReturn the mapped class ultimately represented by this
        :class:`.AliasedInsp`.(RˆR‡(R7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR‡éscCs$|jr|jjStj|ƒSdS(N(RÀRˆt_path_registryRt
per_mapper(R7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRÅïs	
cCs^i	|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd6|jd	6S(
NR–RˆRjRaR¦R£R§R¨R©(	R–RˆRRaRÃR£R¤R¿RÀ(R7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt__getstate__ös







cCsM|j|d|d|d|d|d|d|d|d|d	ƒ	dS(
NR–RˆRjRaR£R§R¨R©R¦(R”(R7RG((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt__setstate__scCs*|jj|ƒji|d6|jd6ƒS(NtparententityRš(RÂttraverset	_annotateRˆ(R7Rž((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_adapt_elementscCsz|j}||krD||jkr(|St|j|jjƒjSn2|j|jƒrZ|Stsvt	d||fƒ‚dS(Ns"mapper %s doesn't correspond to %s(
R£RˆRµR–R‡R?R¥RRLtAssertionError(R7Rˆt	self_poly((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_entity_for_mappers	cCsO|jr,ddjd„|jDƒƒ}nd}dt|ƒ|jj|fS(Ns(%s)s, css|]}|jjVqdS(N(R‡R?(t.0tmp((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pys	<genexpr>*sR:s<AliasedInsp at 0x%x; %s%s>(R£R)R¾R‡R?(R7t	with_poly((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR9's		(R?R@RAR”RSR‘tpropertyR‡Rtmemoized_propertyRÅRÇRÈRÌRÏR9(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR¢¨s"			
		cCs|jS(N(R¥(ttarget((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt<lambda>1scCs|S(N((RÕ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRÖ2sc
Csct|tjƒr=|r*tjdƒ‚n|j|d|ƒSt|d|d|d|d|ƒSdS(s†Produce an alias of the given element, usually an :class:`.AliasedClass`
    instance.

    E.g.::

        my_alias = aliased(MyClass)

        session.query(MyClass, my_alias).filter(MyClass.id > my_alias.id)

    The :func:`.aliased` function is used to create an ad-hoc mapping
    of a mapped class to a new selectable.  By default, a selectable
    is generated from the normally mapped selectable (typically a
    :class:`.Table`) using the :meth:`.FromClause.alias` method.
    However, :func:`.aliased` can also be used to link the class to
    a new :func:`.select` statement.   Also, the :func:`.with_polymorphic`
    function is a variant of :func:`.aliased` that is intended to specify
    a so-called "polymorphic selectable", that corresponds to the union
    of several joined-inheritance subclasses at once.

    For convenience, the :func:`.aliased` function also accepts plain
    :class:`.FromClause` constructs, such as a :class:`.Table` or
    :func:`.select` construct.   In those cases, the :meth:`.FromClause.alias`
    method is called on the object and the new :class:`.Alias` object
    returned.  The returned :class:`.Alias` is not ORM-mapped in this case.

    :param element: element to be aliased.  Is normally a mapped class,
     but for convenience can also be a :class:`.FromClause` element.

    :param alias: Optional selectable unit to map the element to.  This should
     normally be a :class:`.Alias` object corresponding to the :class:`.Table`
     to which the class is mapped, or to a :func:`.select` construct that
     is compatible with the mapping.   By default, a simple anonymous
     alias of the mapped table is generated.

    :param name: optional string name to use for the alias, if not specified
     by the ``alias`` parameter.  The name, among other things, forms the
     attribute name that will be accessible via tuples returned by a
     :class:`.Query` object.

    :param flat: Boolean, will be passed through to the
     :meth:`.FromClause.alias` call so that aliases of :class:`.Join` objects
     don't include an enclosing SELECT.  This can lead to more efficient
     queries in many circumstances.  A JOIN against a nested JOIN will be
     rewritten as a JOIN against an aliased SELECT subquery on backends that
     don't support this syntax.

     .. versionadded:: 0.9.0

     .. seealso:: :meth:`.Join.alias`

    :param adapt_on_names: if True, more liberal "matching" will be used when
     mapping the mapped columns of the ORM entity to those of the
     given selectable - a name-based match will be performed if the
     given selectable doesn't otherwise have a column that corresponds
     to one on the entity.  The use case for this is when associating
     an entity with some derived selectable such as one that uses
     aggregate functions::

        class UnitPrice(Base):
            __tablename__ = 'unit_price'
            ...
            unit_id = Column(Integer)
            price = Column(Numeric)

        aggregated_unit_price = Session.query(
                                    func.sum(UnitPrice.price).label('price')
                                ).group_by(UnitPrice.unit_id).subquery()

        aggregated_unit_price = aliased(UnitPrice,
                    alias=aggregated_unit_price, adapt_on_names=True)

     Above, functions on ``aggregated_unit_price`` which refer to
     ``.price`` will return the
     ``fund.sum(UnitPrice.price).label('price')`` column, as it is
     matched on the name "price".  Ordinarily, the "price" function
     wouldn't have any "column correspondence" to the actual
     ``UnitPrice.price`` column as it is not a proxy of the original.

     .. versionadded:: 0.7.3


    s+adapt_on_names only applies to ORM elementsR RjRaR¦N(R Rt
FromClauseR'R(RjRŸ(telementRjRaR R¦((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytaliased5sSc	

CsÛt|ƒ}	|r}|j|	ks't‚tj|ƒ}tg|jD]}
|
j^qCƒ}||krk|S|j|ƒ}n|	j	||d|ƒ\}}|s§|r¼|j
d|ƒ}nt||d|d|d|ƒS(s±Produce an :class:`.AliasedClass` construct which specifies
    columns for descendant mappers of the given base.

    .. versionadded:: 0.8
        :func:`.orm.with_polymorphic` is in addition to the existing
        :class:`.Query` method :meth:`.Query.with_polymorphic`,
        which has the same purpose but is not as flexible in its usage.

    Using this method will ensure that each descendant mapper's
    tables are included in the FROM clause, and will allow filter()
    criterion to be used against those tables.  The resulting
    instances will also have those columns already loaded so that
    no "post fetch" of those columns will be required.

    See the examples at :ref:`with_polymorphic`.

    :param base: Base class to be aliased.

    :param classes: a single class or mapper, or list of
        class/mappers, which inherit from the base class.
        Alternatively, it may also be the string ``'*'``, in which case
        all descending mapped classes will be added to the FROM clause.

    :param aliased: when True, the selectable will be wrapped in an
        alias, that is ``(SELECT * FROM <fromclauses>) AS anon_1``.
        This can be important when using the with_polymorphic()
        to create the target of a JOIN on a backend that does not
        support parenthesized joins, such as SQLite and older
        versions of MySQL.

    :param flat: Boolean, will be passed through to the
     :meth:`.FromClause.alias` call so that aliases of :class:`.Join`
     objects don't include an enclosing SELECT.  This can lead to more
     efficient queries in many circumstances.  A JOIN against a nested JOIN
     will be rewritten as a JOIN against an aliased SELECT subquery on
     backends that don't support this syntax.

     Setting ``flat`` to ``True`` implies the ``aliased`` flag is
     also ``True``.

     .. versionadded:: 0.9.0

     .. seealso:: :meth:`.Join.alias`

    :param selectable: a table or select() statement that will
        be used in place of the generated FROM clause. This argument is
        required if any of the desired classes use concrete table
        inheritance, since SQLAlchemy currently cannot generate UNIONs
        among tables automatically. If used, the ``selectable`` argument
        must represent the full set of tables and columns mapped by every
        mapped class. Otherwise, the unaccounted mapped columns will
        result in their table being appended directly to the FROM clause
        which will usually lead to incorrect results.

    :param polymorphic_on: a column to be used as the "discriminator"
        column for the given selectable. If not given, the polymorphic_on
        attribute of the base classes' mapper will be used, if any. This
        is useful for mappings that don't have polymorphic loading
        behavior by default.

    :param innerjoin: if True, an INNER JOIN will be used.  This should
       only be specified if querying for one specific subtype only
    t	innerjoinR R£R§R©(RRˆRÍRtto_setR$R£R‡tuniont_with_polymorphic_argsRjRŸ(
R¹tclassesRR R¤RÙRÚRÀt_existing_aliastprimary_mapperRÑtnew_classestmappers((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytwith_polymorphic“s(D	cCstj|itd6|ƒS(s®Deep copy the given ClauseElement, annotating each element with the
    "_orm_adapt" flag.

    Elements within the exclude collection will be cloned but not annotated.

    t
_orm_adapt(Rpt_deep_annotateRS(RØtexclude((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt
_orm_annotateîscCstj|ddƒS(sÔRemove annotations that link a column to a particular mapping.

    Note this doesn't affect "remote" and "foreign" annotations
    passed by the :func:`.orm.foreign` and :func:`.orm.remote`
    annotators.

    R5RäRÉ(s
_orm_adaptsparententity(Rpt_deep_deannotate(RØ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_orm_deannotateøs	cCs
tj|ƒS(N(RpRè(RØ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_orm_full_deannotatest_ORMJoincBsYeZdZejjZdeddd„Zd„Z	dedd„Z
ddd„ZRS(s/Extend Join to support ORM constructs as input.cCs2tj|ƒ}t|d|ƒ}tj|ƒ}	|	j}
|	|_||_||_t|tj	ƒr{t|j
|ƒ}nt|tjƒr¨|j
jƒ}|j}n*t|tƒrÌ|}|jj}nd}|r¡tj||jƒrö|}
n	|j}
|jd|
d|
dtdtd|	jƒ\}}}}}}|dk	r|rntj|||ƒ}|}q•tj||||ƒ}|}n|}||_ntjj|||||ƒ|r.t|	ddƒr.|	jjr.|	jj}|dk	r.|	j r|	j!j"|ƒ}n|j#|@|_#q.ndS(Nt_joined_from_infotsource_selectabletdest_selectabletsource_polymorphictdest_polymorphictof_typeRˆ($RRRµRRìt
_left_memot_right_memoR RR!R–R	tQueryableAttributet
comparatort_source_selectableRÓRtparentR"Rptclause_is_presentt
_create_joinsRSRˆRR)t_target_adapterRtJoinR”tsinglet_single_table_criterionR‘RÂRÊtonclause(R7tlefttrightRþtisouterRòRót	left_infot
left_orm_infot
right_infotadapt_tot
on_selectabletpropt
adapt_fromtpjtsjtsourcetdestt	secondaryttarget_adaptertsingle_crit((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR”sV										c
Cs›|}xt|tjƒr'|j}q	W|j|ks=t‚t|j|j|jd|jd|j	d|j	ƒ}t||j|jd|jd|j
ƒS(slSplice a join into the center.

        Given join(a, b) and join(b, c), return join(a, b).join(c)

        RRòRó(R RRûRÿRRÍRëRþRRòRó(R7tothertleftmostRÿ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt_splice_into_centerSs
	cCst||||ƒS(N(Rë(R7RRþRtjoin_to_left((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR)mscCst|||tƒS(N(RëRS(R7RRþR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt	outerjoinpsN(R?R@RARRût__visit_name__R"RLR”RR)R(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRë
sA	cCst||||ƒS(s¯Produce an inner join between left and right clauses.

    :func:`.orm.join` is an extension to the core join interface
    provided by :func:`.sql.expression.join()`, where the
    left and right selectables may be not only core selectable
    objects such as :class:`.Table`, but also mapped classes or
    :class:`.AliasedClass` instances.   The "on" clause can
    be a SQL expression, or an attribute or string name
    referencing a configured :func:`.relationship`.

    :func:`.orm.join` is not commonly needed in modern usage,
    as its functionality is encapsulated within that of the
    :meth:`.Query.join` method, which features a
    significant amount of automation beyond :func:`.orm.join`
    by itself.  Explicit usage of :func:`.orm.join`
    with :class:`.Query` involves usage of the
    :meth:`.Query.select_from` method, as in::

        from sqlalchemy.orm import join
        session.query(User).\
            select_from(join(User, Address, User.addresses)).\
            filter(Address.email_address=='foo@bar.com')

    In modern SQLAlchemy the above join can be written more
    succinctly as::

        session.query(User).\
                join(User.addresses).\
                filter(Address.email_address=='foo@bar.com')

    See :meth:`.Query.join` for information on modern usage
    of ORM level joins.

    .. versionchanged:: 0.8.1 - the ``join_to_left`` parameter
       is no longer used, and is deprecated.

    (Rë(RÿRRþRR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyR)ts&cCst|||tƒS(sProduce a left outer join between left and right clauses.

    This is the "outer join" version of the :func:`.orm.join` function,
    featuring the same behavior except that an OUTER JOIN is generated.
    See that function's documentation for other usage details.

    (RëRS(RÿRRþR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRscCsat|tjƒr6t|ƒ}t|j|ƒj}nt|tjƒrT|j}n|j	|ƒS(s$Create filtering criterion that relates this query's primary entity
    to the given related instance, using established :func:`.relationship()`
    configuration.

    The SQL rendered is the same as that rendered when a lazy loader
    would fire off from the given parent on that attribute, meaning
    that the appropriate state is taken from the parent object in
    Python without the need to render joins to the parent table
    in the rendered statement.

    .. versionchanged:: 0.6.4
        This method accepts parent instances in all
        persistence states, including transient, persistent, and detached.
        Only the requisite primary key/foreign key attributes need to
        be populated.  Previous versions didn't work with transient
        instances.

    :param instance:
      An instance which has some :func:`.relationship`.

    :param property:
      String property name, or class-bound attribute, which indicates
      what relationship from the instance should be used to reconcile the
      parent/child relationship.

    (
R RR!RRµR‡RÓR	Rôt_with_parent(R|RRˆ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytwith_parent¨scCstj|ƒ}|jS(sÖReturn True if the given object has a database
    identity.

    This typically corresponds to the object being
    in either the persistent or detached state.

    .. seealso::

        :func:`.was_deleted`

    (R	tinstance_statethas_identity(R°RG((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyRÌscCstj|ƒ}|jS(sjReturn True if the given object was deleted
    within a session flush.

    .. versionadded:: 0.8.0

    (R	Rtdeleted(R°RG((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytwas_deletedÜscCskddlm}m}m}m}ddlm}ddlm}||_	|_	|_	|_	|_	dS(s¼Use random-ordering sets within the unit of work in order
    to detect unit of work sorting issues.

    This is a utility function that can be used to help reproduce
    inconsistent unit of work sorting issues.   For example,
    if two kinds of objects A and B are being inserted, and
    B has a foreign key reference to A - the A must be inserted first.
    However, if there is no relationship between A and B, the unit of work
    won't know to perform this sorting, and an operation may or may not
    fail, depending on how the ordering works out.   Since Python sets
    and dictionaries have non-deterministic ordering, such an issue may
    occur on some runs and not on others, and in practice it tends to
    have a great dependence on the state of the interpreter.  This leads
    to so-called "heisenbugs" where changing entirely irrelevant aspects
    of the test program still cause the failure behavior to change.

    By calling ``randomize_unitofwork()`` when a script first runs, the
    ordering of a key series of sets within the unit of work implementation
    are randomized, so that the script can be minimized down to the
    fundamental mapping and operation that's failing, while still reproducing
    the issue on at least some runs.

    This utility is also available when running the test suite via the
    ``--reversetop`` flag.

    .. versionadded:: 0.8.1 created a standalone version of the
       ``--reversetop`` feature.

    iÿÿÿÿ(t
unitofworktsessionRˆt
dependency(ttopological(t	RandomSetN(
tsqlalchemy.ormRRRˆRtsqlalchemy.utilRtsqlalchemy.testing.utilR R$(RRRˆRRR ((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pytrandomize_unitofworkès"(sdeletes
delete-orphansallsmergesexpungessave-updatesrefresh-expiresnone(:R:RRRRR'RRRpRt
interfacesRRR	R;R¹R
RRR
RRRRRRRRt
path_registryRR0RBRRZRSRyR‰R“RŠR°RŸR¢t	_inspectsR"RLRÙRãRçRéRêRûRëR)RRRRR$(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/sqlalchemy/orm/util.pyt<module>	sH(@	7	0?	W q‰^W
		j)	$