HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //proc/self/root/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyc
�
��4]c@sydZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddl
mZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddl	mZddl	mZddl	mZddl	mZddl	mZddl	mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZej r�ddl!Z!nde"fd��YZ#de"fd��YZ$d e"fd!��YZ%d"e$efd#��YZ&d$e&fd%��YZ'd&e&fd'��YZ(d(e'fd)��YZ)d*e#efd+��YZ*d,e*fd-��YZ+d.e*fd/��YZ,d0e#efd1��YZ-d2e-fd3��YZ.d4e#efd5��YZ/d6e#efd7��YZ0d8e#efd9��YZ1d:efd;��YZ2d<e2fd=��YZ3ej4d>d?�d@e3fdA��Y�Z5dBefdC��YZ6dDee&e6fdE��YZ7dFefdG��YZ8dHeee6fdI��YZ9dJe#efdK��YZ:dLee:efdM��YZ;dNe%efdO��YZ<dPee%e$efdQ��YZ=dRe.fdS��YZ>dTe.fdU��YZ?dVe-fdW��YZ@dXe-fdY��YZAdZe*fd[��YZBeBZCd\e+fd]��YZDd^e,fd_��YZEd`e/fda��YZFdbe/fdc��YZGdde0fde��YZHdfe1fdg��YZIdhe'fdi��YZJdje'fdk��YZKdle&fdm��YZLdne(fdo��YZMdpe&fdq��YZNdre(fds��YZOdte3fdu��YZPdve2fdw��YZQdxe2fdy��YZRdze9fd{��YZSd|efd}��YZTd~e9fd��YZUeT�ZVe9�ZWe&�ZXe*�ZYeU�ZZi	e*�e[6e.�e\6eWe]6e-�ej^6e0�ej_6e/�ej6e1�ej`6e;�eja6eVejb6Zcejdr�e3�ecee<e(�ecef<ne(�eceg<e&�ecef<ecjhZid��ZjeWe	_WeXe	_XeYe	_YeVe	_VeZe	_Ze%e	_keje	_jeWejl_WdS(�sSQL specific types.

i����Ni(telements(t	operators(ttype_api(t_bind_or_error(tSchemaEventTarget(t_defer_name(t_literal_as_binds(tquoted_name(tSlice(t
TypeCoerce(tEmulated(tNativeForEmulated(tto_instance(t
TypeDecorator(t
TypeEngine(tVarianti(tevent(texc(t
inspection(t
processors(tutil(tcompat(tpicklet_LookupExpressionAdaptercBs<eZdZed��Zdejfd��YZeZRS(s�Mixin expression adaptations based on lookup tables.

    These rules are currently used by the numeric, integer and date types
    which have detailed cross-expression coercion rules.

    cCs
t��dS(N(tNotImplementedError(tself((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_expression_adaptations7st
ComparatorcBseZej�Zd�ZRS(cCs�|jj}|jjj||j�j||j�}||krO||jfS||jjkrn||jfS|t|�fSdS(N(ttypet_type_affinityRtgett_blank_dictR(Rtoptother_comparatort	othertypetlookup((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_adapt_expression>s

(t__name__t
__module__Rt
immutabledictRR$(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR;s(R%R&t__doc__tpropertyRRRtcomparator_factory(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR.stConcatenablecBs-eZdZdejfd��YZeZRS(sOA mixin that marks a type as supporting 'concatenation',
    typically strings.RcBseZd�ZRS(cCs]|tjkr=t|tjtjf�r=tj|jjfSt	tj|�j
||�SdS(N(Rtaddt
isinstanceR+RtNullTypet	concat_optexprRtsuperR$(RR R!((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR$Ss(R%R&R$(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRRs(R%R&R(RRR*(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR+Mst	IndexablecBs-eZdZdejfd��YZeZRS(s�A mixin that marks a type as supporting indexing operations,
    such as array or JSON structures.


    .. versionadded:: 1.1.0


    RcBseZd�Zd�ZRS(cCs
t��dS(N(R(Rtindex((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_setup_getitemlscCs.|j|�\}}}|j||d|�S(Ntresult_type(R4toperate(RR3tadjusted_optadjusted_right_exprR5((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__getitem__os(R%R&R4R9(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRks	(R%R&R(RRR*(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR2astStringcBs�eZdZdZejdddd�ddedeed��Zd�Z	d	�Z
d
�Zed��Z
d�Zed
��ZRS(s�The base for all string and character types.

    In SQL, corresponds to VARCHAR.  Can also take Python unicode objects
    and encode to the database's encoding in bind params (and the reverse for
    result sets.)

    The `length` field is usually required when the `String` type is
    used within a CREATE TABLE statement, as VARCHAR requires a length
    on most databases.

    tstringtconvert_unicodes1.3s�The :paramref:`.String.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.t
unicode_errors�The :paramref:`.String.unicode_errors` parameter is deprecated and will be removed in a future release.  This parameter is unnecessary for modern Python DBAPIs and degrades performance significantly.cCsa|dk	r*|dkr*tjd��n||_||_|pE||_||_||_dS(s+
        Create a string-holding type.

        :param length: optional, a length for the column for use in
          DDL and CAST expressions.  May be safely omitted if no ``CREATE
          TABLE`` will be issued.  Certain databases may require a
          ``length`` for use in DDL, and will raise an exception when
          the ``CREATE TABLE`` DDL is issued if a ``VARCHAR``
          with no length is included.  Whether the value is
          interpreted as bytes or characters is database specific.

        :param collation: Optional, a column-level collation for
          use in DDL and CAST expressions.  Renders using the
          COLLATE keyword supported by SQLite, MySQL, and PostgreSQL.
          E.g.::

            >>> from sqlalchemy import cast, select, String
            >>> print select([cast('some string', String(collation='utf8'))])
            SELECT CAST(:param_1 AS VARCHAR COLLATE utf8) AS anon_1

        :param convert_unicode: When set to ``True``, the
          :class:`.String` type will assume that
          input is to be passed as Python Unicode objects under Python 2,
          and results returned as Python Unicode objects.
          In the rare circumstance that the DBAPI does not support
          Python unicode under Python 2, SQLAlchemy will use its own
          encoder/decoder functionality on strings, referring to the
          value of the :paramref:`.create_engine.encoding` parameter
          parameter passed to :func:`.create_engine` as the encoding.

          For the extremely rare case that Python Unicode
          is to be encoded/decoded by SQLAlchemy on a backend
          that *does* natively support Python Unicode,
          the string value ``"force"`` can be passed here which will
          cause SQLAlchemy's encode/decode services to be
          used unconditionally.

          .. note::

            SQLAlchemy's unicode-conversion flags and features only apply
            to Python 2; in Python 3, all string objects are Unicode objects.
            For this reason, as well as the fact that virtually all modern
            DBAPIs now support Unicode natively even under Python 2,
            the :paramref:`.String.convert_unicode` flag is inherently a
            legacy feature.

          .. note::

            In the vast majority of cases, the :class:`.Unicode` or
            :class:`.UnicodeText` datatypes should be used for a
            :class:`.Column` that expects to store non-ascii data.  These
            datatypes will ensure that the correct types are used on the
            database side as well as set up the correct Unicode behaviors
            under Python 2.

          .. seealso::

            :paramref:`.create_engine.convert_unicode` -
            :class:`.Engine`-wide parameter

        :param unicode_error: Optional, a method to use to handle Unicode
          conversion errors. Behaves like the ``errors`` keyword argument to
          the standard library's ``string.decode()`` functions, requires
          that :paramref:`.String.convert_unicode` is set to
          ``"force"``

        tforces:convert_unicode must be 'force' when unicode_error is set.N(tNoneRt
ArgumentErrortlengtht	collationt_expect_unicodet_expect_unicode_errort_warn_on_bytestring(RRARBR<R=RERC((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__init__�s\			cs�fd�}|S(Ncs;|jdd�}�jjr3|jdd�}nd|S(Nt's''t%s%%s'%s'(treplacetidentifier_preparert_double_percents(tvalue(tdialect(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytprocess�s((RRMRN((RMsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytliteral_processor�scs��js|jr{|jrG�jdkrG�jr@d�}|SdSn0tj|j���j����fd�}|SdSdS(NR>cSs5t|tj�r1tjdtj|�f�n|S(Ns6Unicode type received non-unicode bind param value %r.(R-Rtbinary_typetwarn_limitedtellipses_string(RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNs
cs[t|tj�r&�|�j�dS�rW|dk	rWtjdtj|�f�n|S(Nis6Unicode type received non-unicode bind param value %r.(R-Rt	text_typeRDR?RQRR(RL(tencoderRtwarn_on_bytestring(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNs(RCR<tsupports_unicode_bindsRER?tcodecst
getencodertencoding(RRMRN((RTRRUsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytbind_processor�s					cCs�|jp|j}|o3|jtk	p3|jdk}|oQ|joQ|jdk}|r�|rvtj|j|j�Stj|j|j�SndSdS(NR>t
force_nocheck(R>R[(
RCR<treturns_unicode_stringstTrueRt(to_conditional_unicode_processor_factoryRYRDtto_unicode_processor_factoryR?(RRMtcoltypet
wants_unicodet
needs_converttneeds_isinstance((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytresult_processor&s	cCs|jrtjStSdS(N(RCRRStstr(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytpython_type=s	cCs|jS(N(tSTRING(Rtdbapi((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytget_dbapi_typeDscCstjd�dS(NsThe convert_unicode on Engine and String as well as the unicode_error flag on String are deprecated.  All modern DBAPIs now support Python Unicode natively under Python 2, and under Python 3 all strings are inherently Unicode.  These flags will be removed in a future release.(Rtwarn_deprecated(tcls((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_warn_deprecated_unicodeGs(s1.3s�The :paramref:`.String.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.(s1.3s�The :paramref:`.String.unicode_errors` parameter is deprecated and will be removed in a future release.  This parameter is unnecessary for modern Python DBAPIs and degrades performance significantly.N(R%R&R(t__visit_name__Rtdeprecated_paramsR?tFalseRFRORZRdR)RfRitclassmethodRl(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR:|s&	Q		'		tTextcBseZdZdZRS(sjA variably sized string type.

    In SQL, usually corresponds to CLOB or TEXT. Can also take Python
    unicode objects and encode to the database's encoding in bind
    params (and the reverse for result sets.)  In general, TEXT objects
    do not have a length; while some databases will accept a length
    argument here, it will be rejected by others.

    ttext(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRqRs
tUnicodecBs eZdZdZdd�ZRS(s�A variable length Unicode string type.

    The :class:`.Unicode` type is a :class:`.String` subclass
    that assumes input and output as Python ``unicode`` data,
    and in that regard is equivalent to the usage of the
    ``convert_unicode`` flag with the :class:`.String` type.
    However, unlike plain :class:`.String`, it also implies an
    underlying column type that is explicitly supporting of non-ASCII
    data, such as ``NVARCHAR`` on Oracle and SQL Server.
    This can impact the output of ``CREATE TABLE`` statements
    and ``CAST`` functions at the dialect level, and can
    also affect the handling of bound parameters in some
    specific DBAPI scenarios.

    The encoding used by the :class:`.Unicode` type is usually
    determined by the DBAPI itself; most modern DBAPIs
    feature support for Python ``unicode`` objects as bound
    values and result set values, and the encoding should
    be configured as detailed in the notes for the target
    DBAPI in the :ref:`dialect_toplevel` section.

    For those DBAPIs which do not support, or are not configured
    to accommodate Python ``unicode`` objects
    directly, SQLAlchemy does the encoding and decoding
    outside of the DBAPI.   The encoding in this scenario
    is determined by the ``encoding`` flag passed to
    :func:`.create_engine`.

    When using the :class:`.Unicode` type, it is only appropriate
    to pass Python ``unicode`` objects, and not plain ``str``.
    If a plain ``str`` is passed under Python 2, a warning
    is emitted.  If you notice your application emitting these warnings but
    you're not sure of the source of them, the Python
    ``warnings`` filter, documented at
    http://docs.python.org/library/warnings.html,
    can be used to turn these warnings into exceptions
    which will illustrate a stack trace::

      import warnings
      warnings.simplefilter('error')

    For an application that wishes to pass plain bytestrings
    and Python ``unicode`` objects to the ``Unicode`` type
    equally, the bytestrings must first be decoded into
    unicode.  The recipe at :ref:`coerce_to_unicode` illustrates
    how this is done.

    .. seealso::

        :class:`.UnicodeText` - unlengthed textual counterpart
        to :class:`.Unicode`.

    tunicodecKs@|jdt�|jdt�tt|�jd||�dS(s�
        Create a :class:`.Unicode` object.

        Parameters are the same as that of :class:`.String`,
        with the exception that ``convert_unicode``
        defaults to ``True``.

        RCRERAN(t
setdefaultR]R1RsRF(RRAtkwargs((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s	N(R%R&R(RmR?RF(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRsas6tUnicodeTextcBs)eZdZdZdd�Zd�ZRS(s#An unbounded-length Unicode string type.

    See :class:`.Unicode` for details on the unicode
    behavior of this object.

    Like :class:`.Unicode`, usage the :class:`.UnicodeText` type implies a
    unicode-capable type being used on the backend, such as
    ``NCLOB``, ``NTEXT``.

    tunicode_textcKs@|jdt�|jdt�tt|�jd||�dS(s�
        Create a Unicode-converting Text type.

        Parameters are the same as that of :class:`.Text`,
        with the exception that ``convert_unicode``
        defaults to ``True``.

        RCRERAN(RuR]R1RwRF(RRARv((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s	cCsdS(N((R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRl�sN(R%R&R(RmR?RFRl(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRw�s
tIntegercBsGeZdZdZd�Zed��Zd�Zej	d��Z
RS(sA type for ``int`` integers.tintegercCs|jS(N(tNUMBER(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRi�scCstS(N(tint(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf�scCs
d�}|S(NcSs
t|�S(N(Re(RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s((RRMRN((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRO�s	cCs�iitt6|jt6tt6tj6itt6|jt6tt6tj6i|jt6tt6tj6i|jt6tt6tj	6i|jt6tt6tj
6S(N(tDatet	__class__RytNumericRR,tIntervaltmultdivttruedivtsub(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s

(R%R&R(RmRiR)RfRORtmemoized_propertyR(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRy�s		tSmallIntegercBseZdZdZRS(s�A type for smaller ``int`` integers.

    Typically generates a ``SMALLINT`` in DDL, and otherwise acts like
    a normal :class:`.Integer` on the Python side.

    t
small_integer(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��st
BigIntegercBseZdZdZRS(s�A type for bigger ``int`` integers.

    Typically generates a ``BIGINT`` in DDL, and otherwise acts like
    a normal :class:`.Integer` on the Python side.

    tbig_integer(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sRcBs�eZdZdZdZddded�Zed��Z	d�Z
d�Zed��Zd�Z
d	�Zejd
��ZRS(s�A type for fixed precision numbers, such as ``NUMERIC`` or ``DECIMAL``.

    This type returns Python ``decimal.Decimal`` objects by default, unless
    the :paramref:`.Numeric.asdecimal` flag is set to False, in which case
    they are coerced to Python ``float`` objects.

    .. note::

        The :class:`.Numeric` type is designed to receive data from a database
        type that is explicitly known to be a decimal type
        (e.g. ``DECIMAL``, ``NUMERIC``, others) and not a floating point
        type (e.g. ``FLOAT``, ``REAL``, others).
        If the database column on the server is in fact a floating-point type
        type, such as ``FLOAT`` or ``REAL``, use the :class:`.Float`
        type or a subclass, otherwise numeric coercion between
        ``float``/``Decimal`` may or may not function as expected.

    .. note::

       The Python ``decimal.Decimal`` class is generally slow
       performing; cPython 3.3 has now switched to use the `cdecimal
       <http://pypi.python.org/pypi/cdecimal/>`_ library natively. For
       older Python versions, the ``cdecimal`` library can be patched
       into any application where it will replace the ``decimal``
       library fully, however this needs to be applied globally and
       before any other modules have been imported, as follows::

           import sys
           import cdecimal
           sys.modules["decimal"] = cdecimal

       Note that the ``cdecimal`` and ``decimal`` libraries are **not
       compatible with each other**, so patching ``cdecimal`` at the
       global level is the only way it can be used effectively with
       various DBAPIs that hardcode to import the ``decimal`` library.

    tnumerici
cCs(||_||_||_||_dS(s�
        Construct a Numeric.

        :param precision: the numeric precision for use in DDL ``CREATE
          TABLE``.

        :param scale: the numeric scale for use in DDL ``CREATE TABLE``.

        :param asdecimal: default True.  Return whether or not
          values should be sent as Python Decimal objects, or
          as floats.   Different DBAPIs send one or the other based on
          datatypes - the Numeric type will ensure that return values
          are one or the other across DBAPIs consistently.

        :param decimal_return_scale: Default scale to use when converting
         from floats to Python decimals.  Floating point values will typically
         be much longer due to decimal inaccuracy, and most floating point
         database types don't have a notion of "scale", so by default the
         float type looks for the first ten decimal places when converting.
         Specifying this value will override that length.  Types which
         do include an explicit ".scale" value, such as the base
         :class:`.Numeric` as well as the MySQL float types, will use the
         value of ".scale" as the default for decimal_return_scale, if not
         otherwise specified.

         .. versionadded:: 0.9.0

        When using the ``Numeric`` type, care should be taken to ensure
        that the asdecimal setting is appropriate for the DBAPI in use -
        when Numeric applies a conversion from Decimal->float or float->
        Decimal, this conversion incurs an additional performance overhead
        for all result columns received.

        DBAPIs that return Decimal natively (e.g. psycopg2) will have
        better accuracy and higher performance with a setting of ``True``,
        as the native translation to Decimal reduces the amount of floating-
        point issues at play, and the Numeric type itself doesn't need
        to apply any further conversions.  However, another DBAPI which
        returns floats natively *will* incur an additional conversion
        overhead, and is still subject to floating point data loss - in
        which case ``asdecimal=False`` will at least remove the extra
        conversion overhead.

        N(t	precisiontscaletdecimal_return_scalet	asdecimal(RR�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF5s3			cCs@|jdk	r|jSt|dd�dk	r5|jS|jSdS(NR�(R�R?tgetattrR�t_default_decimal_return_scale(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_effective_decimal_return_scalems
cCs|jS(N(R{(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRivscCs
d�}|S(NcSs
t|�S(N(Re(RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNzs((RRMRN((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyROys	cCs|jrtjStSdS(N(R�tdecimaltDecimaltfloat(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRfs	cCs|jr
dStjSdS(N(tsupports_native_decimalR?Rtto_float(RRM((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZ�s	cCs||jrd|jrdStjd|j|jf�tjt	j
|jdk	rW|jn|j�Sn|jrttj
SdSdS(Ns�Dialect %s+%s does *not* support Decimal objects natively, and SQLAlchemy must convert from floating point - rounding errors and other issues may occur. Please consider storing Decimal numbers as strings or integers on this platform for lossless storage.(R�R�R?RtwarntnametdriverRtto_decimal_processor_factoryR�R�R�R�R�(RRMR`((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s		
	cCs�iitt6|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj6i|jt6|jt6tj	6S(N(
R�R~RRyRR�R�R�R,R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s

N(R%R&R(RmR�R?R]RFR)R�RiRORfRZRdRR�R(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR	s&3					tFloatcBs5eZdZdZdZdedd�Zd�ZRS(s.Type representing floating point types, such as ``FLOAT`` or ``REAL``.

    This type returns Python ``float`` objects by default, unless the
    :paramref:`.Float.asdecimal` flag is set to True, in which case they
    are coerced to ``decimal.Decimal`` objects.

    .. note::

        The :class:`.Float` type is designed to receive data from a database
        type that is explicitly known to be a floating point type
        (e.g. ``FLOAT``, ``REAL``, others)
        and not a decimal type (e.g. ``DECIMAL``, ``NUMERIC``, others).
        If the database column on the server is in fact a Numeric
        type, such as ``DECIMAL`` or ``NUMERIC``, use the :class:`.Numeric`
        type or a subclass, otherwise numeric coercion between
        ``float``/``Decimal`` may or may not function as expected.

    R�cCs||_||_||_dS(s�
        Construct a Float.

        :param precision: the numeric precision for use in DDL ``CREATE
           TABLE``.

        :param asdecimal: the same flag as that of :class:`.Numeric`, but
          defaults to ``False``.   Note that setting this flag to ``True``
          results in floating point conversion.

        :param decimal_return_scale: Default scale to use when converting
         from floats to Python decimals.  Floating point values will typically
         be much longer due to decimal inaccuracy, and most floating point
         database types don't have a notion of "scale", so by default the
         float type looks for the first ten decimal places when converting.
         Specifying this value will override that length.  Note that the
         MySQL float types, which do include "scale", will use "scale"
         as the default for decimal_return_scale, if not otherwise specified.

         .. versionadded:: 0.9.0

        N(R�R�R�(RR�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s		cCs7|jrtjtj|j�S|jr/tjSdSdS(N(	R�RR�R�R�R�R�R�R?(RRMR`((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s		N(	R%R&R(RmR?R�RoRFRd(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
tDateTimecBsJeZdZdZed�Zd�Zed��Ze	j
d��ZRS(sA type for ``datetime.datetime()`` objects.

    Date and time types return objects from the Python ``datetime``
    module.  Most DBAPIs have built in support for the datetime
    module, with the noted exception of SQLite.  In the case of
    SQLite, date and time types are stored as strings which are then
    converted back to datetime objects when rows are returned.

    For the time representation within the datetime type, some
    backends include additional options, such as timezone support and
    fractional seconds support.  For fractional seconds, use the
    dialect-specific datatype, such as :class:`.mysql.TIME`.  For
    timezone support, use at least the :class:`~.types.TIMESTAMP` datatype,
    if not the dialect-specific datatype object.

    tdatetimecCs
||_dS(s�Construct a new :class:`.DateTime`.

        :param timezone: boolean.  Indicates that the datetime type should
         enable timezone support, if available on the
         **base date/time-holding type only**.   It is recommended
         to make use of the :class:`~.types.TIMESTAMP` datatype directly when
         using this flag, as some databases include separate generic
         date/time-holding types distinct from the timezone-capable
         TIMESTAMP datatype, such as Oracle.


        N(ttimezone(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRFs
cCs|jS(N(tDATETIME(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRi scCstjS(N(tdtR�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf#scCs3ii|jt6tj6i|jt6tt6tj6S(N(R~R�RR,R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR's(R%R&R(RmRoRFRiR)RfRR�R(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s	R}cBs>eZdZdZd�Zed��Zejd��Z	RS(s'A type for ``datetime.date()`` objects.tdatecCs|jS(N(R�(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRi9scCstjS(N(R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf<scCsOii|jt6tt6tt6tj6i|jt6tt6tt6tt6tj6S(N(	R~RyR�R�tTimeRR,R}R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR@s

(
R%R&R(RmRiR)RfRR�R(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR}3s
	R�cBsJeZdZdZed�Zd�Zed��Ze	j
d��ZRS(s'A type for ``datetime.time()`` objects.ttimecCs
||_dS(N(R�(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF_scCs|jS(N(R�(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRibscCstjS(N(R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRfescCs:iitt6|jt6tj6itt6|jt6tj6S(N(R�R}R~R�RR,R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRis(R%R&R(RmRoRFRiR)RfRR�R(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�Ys	t_BinarycBskeZdZd	d�Zd�Zed��Zd�Ze	j
rNd�Zn	d�Zd�Zd�Z
RS(
s&Define base behavior for binary types.cCs
||_dS(N(RA(RRA((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRFxscs�fd�}|S(Ncs&|j�j�jdd�}d|S(NRGs''s'%s'(tdecodeRYRI(RL(RM(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN|s((RRMRN((RMsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRO{scCstjS(N(RRP(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf�scs2|jdkrdS|jj��fd�}|S(Ncs|dk	r�|�SdSdS(N(R?(RL(tDBAPIBinary(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s
(RhR?tBinary(RRMRN((R�sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZ�s
cCs"tjrd�}n	tj}|S(NcSs:|dk	r2t|tj�r(|j�St|�SdSdS(N(R?R-tarrayttostringRe(RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s


(RtjythonRtto_str(RRMR`RN((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s			cCs
d�}|S(NcSs|dk	rt|�}n|S(N(R?tbytes(RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s((RRMR`RN((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s	cCs3t|tj�r|Stt|�j||�SdS(s@See :meth:`.TypeEngine.coerce_compared_value` for a description.N(R-Rtstring_typesR1R�tcoerce_compared_value(RR RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��scCs|jS(N(tBINARY(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRi�sN(R%R&R(R?RFROR)RfRZRtpy2kRdR�Ri(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�ts					tLargeBinarycBs eZdZdZdd�ZRS(sA type for large binary byte data.

    The :class:`.LargeBinary` type corresponds to a large and/or unlengthed
    binary type for the target platform, such as BLOB on MySQL and BYTEA for
    PostgreSQL.  It also handles the necessary conversions for the DBAPI.

    tlarge_binarycCstj|d|�dS(s�
        Construct a LargeBinary type.

        :param length: optional, a length for the column for use in
          DDL statements, for those binary types that accept a length,
          such as the MySQL BLOB type.

        RAN(R�RF(RRA((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s	N(R%R&R(RmR?RF(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��ss0.6ssThe :class:`.Binary` class is deprecated and will be removed in a future relase.  Please use :class:`.LargeBinary`.R�cBseZd�ZRS(cOstj|||�dS(N(R�RF(Rtargtkw((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s(R%R&RF(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��st
SchemaTypecBs�eZdZdddeded�Zd�Zd�Zd�Z	d�Z
d�Zd�Ze
d��Zded	�Zded
�Zd�Zd�Zd
�Zd�Zd�ZRS(s[Mark a type as possibly requiring schema-level DDL for usage.

    Supports types that must be explicitly created/dropped (i.e. PG ENUM type)
    as well as types that are complimented by table or schema level
    constraints, triggers, and other rules.

    :class:`.SchemaType` classes can also be targets for the
    :meth:`.DDLEvents.before_parent_attach` and
    :meth:`.DDLEvents.after_parent_attach` events, where the events fire off
    surrounding the association of the type object with a parent
    :class:`.Column`.

    .. seealso::

        :class:`.Enum`

        :class:`.Boolean`


    cCs�|dk	r!t||�|_n	d|_||_||_||_||_|r�|jr�tj|jdt	j
|j��tj|jdt	j
|j��ndS(Nt
before_createt
after_drop(
R?RR�tschematmetadatatinherit_schemat_create_eventsRtlistenRtportable_instancemethodt_on_metadata_createt_on_metadata_drop(RR�R�R�R�tquoteR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s 						cCs|j||�S(N(R(Rteffective_schematmap_((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_translate_schemascCs|jtj|j��dS(N(t_on_table_attachRR�t
_set_table(Rtcolumn((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_set_parentscCsAt|jt�r7|jjj�}|jj|d<nd}|S(Nt_default(R-RRtmappingtcopytimplR?(RR�tvariant_mapping((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_variant_mapping_for_set_tables
cCs�|jr|j|_n|js%dS|j|�}tj|dtj|ji|d6��tj|dtj|j	i|d6��|j
dkr�tj|j
dtj|ji|d6��tj|j
dtj|j
i|d6��ndS(NR�R�R�(R�R�R�R�RR�RR�t_on_table_createt_on_table_dropR�R?R�R�(RR�ttableR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�%s8		cKs|j|jdt�S(NR�(tadaptR~R](RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�PscKsj|jd|j�}|jd|j�}|jdt�}|d|jd|d|jd|d||�S(NR�R�R�R�R�(tpopR�R�RoR�R�(RtimpltypeR�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�Ss		cCs|jr|jjpdS(N(R�tbindR?(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�`scCsk|dkrt|�}n|j|j�}|j|jk	rgt|t�rg|jd|d|�ndS(s.Issue CREATE ddl for this type, if applicable.R�t
checkfirstN(R?Rtdialect_implRMR~R-R�tcreate(RR�R�tt((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�ds
!cCsk|dkrt|�}n|j|j�}|j|jk	rgt|t�rg|jd|d|�ndS(s,Issue DROP ddl for this type, if applicable.R�R�N(R?RR�RMR~R-R�tdrop(RR�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�ms
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(t_is_impl_for_variantRMR�R~R-R�R�(RttargetR�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�vs
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RMR�R~R-R�R�(RR�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�~s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RMR�R~R-R�R�(RR�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cKsf|j|j|�sdS|j|j�}|j|jk	rbt|t�rb|j|||�ndS(N(R�RMR�R~R-R�R�(RR�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
!cCsi|jdd�}|dkr"tS|j|krH||j|krHtS|j|kre|d|kSdS(NR�R�(R�R?R]R�(RRMR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��sN(R%R&R(R?RoR]RFR�R�R�R�R�R�R)R�R�R�R�R�R�R�R�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s*				+		
						tEnumcBseZdZdZejdd�d��Zed��Zd�Z	d�Z
d	�Zed
��Zd�Z
dejfd
��YZeZd�Zd�Zd�Zd�Zd�Zejd�d��Zd�Zd�Zd�Zd�Zed��ZRS(sTGeneric Enum Type.

    The :class:`.Enum` type provides a set of possible string values
    which the column is constrained towards.

    The :class:`.Enum` type will make use of the backend's native "ENUM"
    type if one is available; otherwise, it uses a VARCHAR datatype and
    produces a CHECK constraint.  Use of the backend-native enum type
    can be disabled using the :paramref:`.Enum.native_enum` flag, and
    the production of the CHECK constraint is configurable using the
    :paramref:`.Enum.create_constraint` flag.

    The :class:`.Enum` type also provides in-Python validation of string
    values during both read and write operations.  When reading a value
    from the database in a result set, the string value is always checked
    against the list of possible values and a ``LookupError`` is raised
    if no match is found.  When passing a value to the database as a
    plain string within a SQL statement, if the
    :paramref:`.Enum.validate_strings` parameter is
    set to True, a ``LookupError`` is raised for any string value that's
    not located in the given list of possible values; note that this
    impacts usage of LIKE expressions with enumerated values (an unusual
    use case).

    .. versionchanged:: 1.1 the :class:`.Enum` type now provides in-Python
       validation of input values as well as on data being returned by
       the database.

    The source of enumerated values may be a list of string values, or
    alternatively a PEP-435-compliant enumerated class.  For the purposes
    of the :class:`.Enum` datatype, this class need only provide a
    ``__members__`` method.

    When using an enumerated class, the enumerated objects are used
    both for input and output, rather than strings as is the case with
    a plain-string enumerated type::

        import enum
        class MyEnum(enum.Enum):
            one = 1
            two = 2
            three = 3

        t = Table(
            'data', MetaData(),
            Column('value', Enum(MyEnum))
        )

        connection.execute(t.insert(), {"value": MyEnum.two})
        assert connection.scalar(t.select()) is MyEnum.two

    Above, the string names of each element, e.g. "one", "two", "three",
    are persisted to the database; the values of the Python Enum, here
    indicated as integers, are **not** used; the value of each enum can
    therefore be any kind of Python object whether or not it is persistable.

    In order to persist the values and not the names, the
    :paramref:`.Enum.values_callable` parameter may be used.   The value of
    this parameter is a user-supplied callable, which  is intended to be used
    with a PEP-435-compliant enumerated class and  returns a list of string
    values to be persisted.   For a simple enumeration that uses string values,
    a callable such as  ``lambda x: [e.value for e in x]`` is sufficient.

    .. versionadded:: 1.1 - support for PEP-435-style enumerated
       classes.


    .. seealso::

        :class:`.postgresql.ENUM` - PostgreSQL-specific type,
        which has additional functionality.

        :class:`.mysql.ENUM` - MySQL-specific type

    tenumR<s1.3s�The :paramref:`.Enum.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.cOs|j||�dS(s�Construct an enum.

        Keyword arguments which don't apply to a specific backend are ignored
        by that backend.

        :param \*enums: either exactly one PEP-435 compliant enumerated type
           or one or more string or unicode enumeration labels. If unicode
           labels are present, the `convert_unicode` flag is auto-enabled.

           .. versionadded:: 1.1 a PEP-435 style enumerated class may be
              passed.

        :param convert_unicode: Enable unicode-aware bind parameter and
           result-set processing for this Enum's data. This is set
           automatically based on the presence of unicode label strings.

        :param create_constraint: defaults to True.  When creating a non-native
           enumerated type, also build a CHECK constraint on the database
           against the valid values.

           .. versionadded:: 1.1 - added :paramref:`.Enum.create_constraint`
              which provides the option to disable the production of the
              CHECK constraint for a non-native enumerated type.

        :param metadata: Associate this type directly with a ``MetaData``
           object. For types that exist on the target database as an
           independent schema construct (PostgreSQL), this type will be
           created and dropped within ``create_all()`` and ``drop_all()``
           operations. If the type is not associated with any ``MetaData``
           object, it will associate itself with each ``Table`` in which it is
           used, and will be created when any of those individual tables are
           created, after a check is performed for its existence. The type is
           only dropped when ``drop_all()`` is called for that ``Table``
           object's metadata, however.

        :param name: The name of this type. This is required for PostgreSQL
           and any future supported database which requires an explicitly
           named type, or an explicitly named constraint in order to generate
           the type and/or a table that uses it. If a PEP-435 enumerated
           class was used, its name (converted to lower case) is used by
           default.

        :param native_enum: Use the database's native ENUM type when
           available. Defaults to True. When False, uses VARCHAR + check
           constraint for all backends.

        :param schema: Schema name of this type. For types that exist on the
           target database as an independent schema construct (PostgreSQL),
           this parameter specifies the named schema in which the type is
           present.

           .. note::

                The ``schema`` of the :class:`.Enum` type does not
                by default make use of the ``schema`` established on the
                owning :class:`.Table`.  If this behavior is desired,
                set the ``inherit_schema`` flag to ``True``.

        :param quote: Set explicit quoting preferences for the type's name.

        :param inherit_schema: When ``True``, the "schema" from the owning
           :class:`.Table` will be copied to the "schema" attribute of this
           :class:`.Enum`, replacing whatever value was passed for the
           ``schema`` attribute.   This also takes effect when using the
           :meth:`.Table.tometadata` operation.

        :param validate_strings: when True, string values that are being
           passed to the database in a SQL statement will be checked
           for validity against the list of enumerated values.  Unrecognized
           values will result in a ``LookupError`` being raised.

           .. versionadded:: 1.1.0b2

        :param values_callable: A callable which will be passed the PEP-435
           compliant enumerated type, which should then return a list of string
           values to be persisted. This allows for alternate usages such as
           using the string value of an enum to be persisted to the database
           instead of its name.

           .. versionadded:: 1.2.3

        N(t
_enum_init(RtenumsR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s\cCs$|jdk	r|jgS|jSdS(N(t
enum_classR?R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_enums_argumentQs
c	Cs�|jdt�|_|jdt�|_|jdd�|_|j||�\}}|j|||�|jdd�}|jdt�|_	|dkr�x<|j
D]"}t|tj
�r�t}Pq�q�Wt}n|}|j
rtd�|j
D��}nd}d|jd<|jd<tt|�jd|d	|�|jrf|jd
|jjj��ntj|d
|jd
d�d|jdd�d|jdd�d
|jd
t�d|jdd�d|jdt��dS(s�internal init for :class:`.Enum` and subclasses.

        friendly init helper used by subclasses to remove
        all the Enum-specific keyword arguments from kw.  Allows all
        other arguments in kw to pass through.

        tnative_enumtcreate_constrainttvalues_callableR<tvalidate_stringscss|]}t|�VqdS(N(tlen(t.0tx((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pys	<genexpr>wsiRARCR�R�R�R�R�R�N(R�R]R�R�R?R�t_parse_into_valuest_setup_for_valuesRoR�R�R-RRStmaxt
_valid_lookupt_object_lookupR1R�RFR�RuR%tlowerR�(	RR�R�tvaluestobjectsR<teRCRA((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�Xs<		
	cCs�|r%d|kr%|jd�}nt|�dkr�t|dd�r�|d|_|jj}|jr�|j|j�}nt|�}g|D]}||^q�}||fSd|_||fSdS(Nt_enumsiit__members__(R�R�thasattrR�R�R�tlistR?(RR�R�tmembersR�tkR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s%
	
	cCs�t|�|_ttt|�t|���|_tt||��|_|jjg|D] }||j|j|f^q[�dS(N(R�R�tdicttziptreversedR�R�tupdate(RR�R�R�RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s$	cCs|jS(N(R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytnative�scCsWy|j|SWnAtk
rR|jr?t|tj�r?|Std|��nXdS(Ns)"%s" is not among the defined enum values(R�tKeyErrorR�R-RR�tLookupError(Rtelem((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_db_value_for_elem�s
	
RcBseZd�ZRS(cCs^ttj|�j||�\}}|tjkrTt|jjd|jj	�}n||fS(NRC(
R1R�RR$RR/R:RRARC(RR R!ttyp((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR$�s(R%R&R$(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�scCs7y|j|SWn!tk
r2td|��nXdS(Ns)"%s" is not among the defined enum values(R�R�R�(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_object_value_for_elem�s

cCs(tj|ddtfgdttg�S(Nt
additional_kwR�t
to_inspect(Rtgeneric_reprR]R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt__repr__�scKs�|jd|j�|jd|j�|jd|j�|jd|j�|jd|j�|jd|j�|jdt�|jd|j�|jd	|j	�|jd
|j
�d|ks�t�||�S(NRCR�R�R�R�R�R�R�R�R�R�(RuRCR�R�R�R�R�RoR�R�R�tAssertionError(RR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytadapt_to_emulated�scKs&|j|d<tt|�j||�S(NR�(R�R1R�R�(RR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s
cKs.|j|j|�stS|jp-|jjS(N(R�RMRoR�tsupports_native_enum(RtcompilerR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_should_create_constraint�sssqlalchemy.sql.schemac
Cs�tj|||�|js dS|j|�}|jt||�j|j�dt|j	�dt
j|ji|d6�dt
�}|j|ks�t�dS(NR�t_create_ruleR�t_type_bound(R�R�R�R�tCheckConstraintttype_coercetin_R�RR�RR�RR]R�R(RR�R�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s		cs.tt��j|����fd�}|S(Ncs(�j|�}�r$�|�}n|S(N(R(RL(tparent_processorR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNs(R1R�RO(RRMRN((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRO
scs.��fd�}tt��j|��|S(Ncs(�j|�}�r$�|�}n|S(N(R(RL(RR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNs(R1R�RZ(RRMRN((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZscs1tt��j||����fd�}|S(Ncs(�r�|�}n�j|�}|S(N(R(RL(RR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN%s(R1R�Rd(RRMR`RN((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd"scKstj||�S(N(R�R�(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�.scCs$|jr|jStt|�jSdS(N(R�R1R�Rf(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf1s	(s1.3s�The :paramref:`.Enum.convert_unicode` parameter is deprecated and will be removed in a future release.  All modern DBAPIs now support Python Unicode directly and this parameter is unnecessary.(R%R&R(RmRRnRFR)R�R�R�R�R�RR:RR*RRRR�RtdependenciesR�RORZRdR�Rf(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s0K	[	4										
		t
PickleTypecBsMeZdZeZejddd�Zd�Z	d�Z
d�Zd�ZRS(s�Holds Python objects, which are serialized using pickle.

    PickleType builds upon the Binary type to apply Python's
    ``pickle.dumps()`` to incoming objects, and ``pickle.loads()`` on
    the way out, allowing any pickleable Python object to be stored as
    a serialized binary field.

    To allow ORM change events to propagate for elements associated
    with :class:`.PickleType`, see :ref:`mutable_toplevel`.

    cCs8||_|pt|_||_tt|�j�dS(s�
        Construct a PickleType.

        :param protocol: defaults to ``pickle.HIGHEST_PROTOCOL``.

        :param pickler: defaults to cPickle.pickle or pickle.pickle if
          cPickle is not available.  May be any object with
          pickle-compatible ``dumps` and ``loads`` methods.

        :param comparator: a 2-arg callable predicate used
          to compare values of this type.  If left as ``None``,
          the Python "equals" operator is used to compare values.

        N(tprotocolRtpicklert
comparatorR1RRF(RRRR((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRFHs		cCst|jd|jffS(N(RRR?R(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt
__reduce__^scs[|jj|��|jj�|j��rE���fd�}n��fd�}|S(Ncs(|dk	r�|��}n�|�S(N(R?(RL(tdumpstimpl_processorR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNgscs"|dk	r�|��}n|S(N(R?(RL(RR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNns(R�RZRRR(RRMRN((RRRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZas	csO|jj||��|jj��r<��fd�}n�fd�}|S(Ncs&�|�}|dkrdS�|�S(N(R?(RL(Rtloads(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNzscs|dkrdS�|�S(N(R?(RL(R(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s(R�RdRR(RRMR`RN((RRsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRduscCs'|jr|j||�S||kSdS(N(R(RR�ty((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytcompare_values�s	N(
R%R&R(R�R�RtHIGHEST_PROTOCOLR?RFRRZRdR(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR9s			tBooleancBs�eZdZdZeZeded�Zd�Ze	j
d�d��Zed��Z
edeeg�Zd�Zd�Zd	�Zd
�ZRS(sBA bool datatype.

    :class:`.Boolean` typically uses BOOLEAN or SMALLINT on the DDL side,
    and on the Python side deals in ``True`` or ``False``.

    The :class:`.Boolean` datatype currently has two levels of assertion
    that the values persisted are simple true/false values.  For all
    backends, only the Python values ``None``, ``True``, ``False``, ``1``
    or ``0`` are accepted as parameter values.   For those backends that
    don't support a "native boolean" datatype, a CHECK constraint is also
    created on the target column.   Production of the CHECK constraint
    can be disabled by passing the :paramref:`.Boolean.create_constraint`
    flag set to ``False``.

    .. versionchanged:: 1.2 the :class:`.Boolean` datatype now asserts that
       incoming Python values are already in pure boolean form.


    tbooleancCs||_||_||_dS(sLConstruct a Boolean.

        :param create_constraint: defaults to True.  If the boolean
          is generated as an int/smallint, also create a CHECK constraint
          on the table that ensures 1 or 0 as a value.

        :param name: if a CHECK constraint is generated, specify
          the name of the constraint.

        N(R�R�R�(RR�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�s		cKs0|j|j|�stS|jjo/|jjS(N(R�RMRotsupports_native_booleant#non_native_boolean_check_constraint(RR
R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s
ssqlalchemy.sql.schemac
Cs�|js
dS|j|�}|jt||�jddg�dt|j�dtj|j	i|d6�dt
�}|j|ks�t�dS(NiiR�RR�R
(
R�R�RRRRR�RR�RR]R�R(RR�R�R�R�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��s		cCstS(N(tbool(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf�scCsH||jkrDt|t�s1td|��qDtd|��n|S(NsNot a boolean value: %rs$Value %r is not None, True, or False(t
_strict_boolsR-R|t	TypeErrort
ValueError(RRL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_strict_as_bool�scsI|j|d�}|jd��|jd�����fd�}|S(Ncs�j|�r�S�S(N(R&(RL(tfalseRttrue(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s(tstatement_compilerR?t
visit_truetvisit_false(RRMR
RN((R'RR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRO�s
cs7|j�|jrt�nt���fd�}|S(Ncs+�|�}|dk	r'�|�}n|S(N(R?(RL(t_coerceR&(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s(R&R R"R|(RRMRN((R,R&sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZ�s			cCs|jr
dStjSdS(N(R R?Rtint_to_boolean(RRMR`((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s	N(R%R&R(RmR]R�R?RFRRRR�R)Rft	frozensetRoR#R&RORZRd(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s		
	
	t_AbstractIntervalcBs2eZejd��Zed��Zd�ZRS(cCs}iitt6|jt6tt6tt6tj6i|jt6tj6i|jt6tj	6i|jt6tj
6i|jt6tj6S(N(R�R}R~R�R�RR,R�RR�R�R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRs
cCstS(N(R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRscCs|jj||�S(s@See :meth:`.TypeEngine.coerce_compared_value` for a description.(R�R�(RR RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s(R%R&RR�RR)RR�(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR/sR�cBsbeZdZeZejjd�Ze	ddd�Zed��Z
d�Zd�Zd�ZRS(s�A type for ``datetime.timedelta()`` objects.

    The Interval type deals with ``datetime.timedelta`` objects.  In
    PostgreSQL, the native ``INTERVAL`` type is used; for others, the
    value is stored as a date which is relative to the "epoch"
    (Jan. 1, 1970).

    Note that the ``Interval`` type does not currently provide date arithmetic
    operations on platforms which do not support interval types natively. Such
    operations usually require transformation of both sides of the expression
    (such as, conversion of both sides into integer epoch values first) which
    currently is a manual procedure (such as via
    :attr:`~sqlalchemy.sql.expression.func`).

    icCs2tt|�j�||_||_||_dS(s;Construct an Interval object.

        :param native: when True, use the actual
          INTERVAL type provided by the database, if
          supported (currently PostgreSQL, Oracle).
          Otherwise, represent the interval data as
          an epoch value regardless.

        :param second_precision: For native interval types
          which support a "fractional seconds precision" parameter,
          i.e. Oracle and PostgreSQL

        :param day_precision: for native interval types which
          support a "day precision" parameter, i.e. Oracle.

        N(R1R�RFR�tsecond_precisiont
day_precision(RR�R0R1((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF3s		cCstjS(N(R�t	timedelta(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRfIscKstj|||�S(N(R/R�(RR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRMscsI|jj|��|j��r6��fd�}n�fd�}|S(Ncs#|dk	r�|}n�|�S(N(R?(RL(tepochR(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNUs
cs|dk	r�|}n|S(N(R?(RL(R3(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN\s
(R�RZR3(RRMRN((R3RsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZPs	csL|jj||��|j��r9��fd�}n�fd�}|S(Ncs$�|�}|dkrdS|�S(N(R?(RL(R3R(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNhscs|dkrdS|�S(N(R?(RL(R3(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNps(R�RdR3(RRMR`RN((R3RsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRdcs	N(R%R&R(R�R�R�R�tutcfromtimestampR3R]R?RFR)RfRRZRd(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�s		tJSONcBs�eZdZdZeZejd�Zed�Z	de
fd��YZdefd��YZdefd	��YZ
d
ejejfd��YZeZed��Zed
��Zejd��Zejd��Zd�Zd�ZRS(sxRepresent a SQL JSON type.

    .. note::  :class:`.types.JSON` is provided as a facade for vendor-specific
       JSON types.  Since it supports JSON SQL operations, it only
       works on backends that have an actual JSON type, currently:

       * PostgreSQL

       * MySQL as of version 5.7 (MariaDB as of the 10.2 series does not)

       * SQLite as of version 3.9

    :class:`.types.JSON` is part of the Core in support of the growing
    popularity of native JSON datatypes.

    The :class:`.types.JSON` type stores arbitrary JSON format data, e.g.::

        data_table = Table('data_table', metadata,
            Column('id', Integer, primary_key=True),
            Column('data', JSON)
        )

        with engine.connect() as conn:
            conn.execute(
                data_table.insert(),
                data = {"key1": "value1", "key2": "value2"}
            )

    The base :class:`.types.JSON` provides these operations:

    * Keyed index operations::

        data_table.c.data['some key']

    * Integer index operations::

        data_table.c.data[3]

    * Path index operations::

        data_table.c.data[('key_1', 'key_2', 5, ..., 'key_n')]

    Additional operations are available from the dialect-specific versions
    of :class:`.types.JSON`, such as :class:`.postgresql.JSON` and
    :class:`.postgresql.JSONB`, each of which offer more operators than
    just the basic type.

    Index operations return an expression object whose type defaults to
    :class:`.JSON` by default, so that further JSON-oriented instructions may
    be called upon the result type.   Note that there are backend-specific
    idiosyncrasies here, including that the PostgreSQL database does not
    generally compare a "json" to a "json" structure without type casts.  These
    idiosyncrasies can be accommodated in a backend-neutral way by making
    explicit use of the :func:`.cast` and :func:`.type_coerce` constructs.
    Comparison of specific index elements of a :class:`.JSON` object to other
    objects works best if the **left hand side is CAST to a string** and the
    **right hand side is rendered as a JSON string**; a future SQLAlchemy
    feature such as a generic "astext" modifier may simplify this at some
    point:

    * **Compare an element of a JSON structure to a string**::

        from sqlalchemy import cast, type_coerce
        from sqlalchemy import String, JSON

        cast(
            data_table.c.data['some_key'], String
        ) == '"some_value"'

        cast(
            data_table.c.data['some_key'], String
        ) == type_coerce("some_value", JSON)

    * **Compare an element of a JSON structure to an integer**::

        from sqlalchemy import cast, type_coerce
        from sqlalchemy import String, JSON

        cast(data_table.c.data['some_key'], String) == '55'

        cast(
            data_table.c.data['some_key'], String
        ) == type_coerce(55, JSON)

    * **Compare an element of a JSON structure to some other JSON structure**
      - note that Python dictionaries are typically not ordered so care should
      be taken here to assert that the JSON structures are identical::

        from sqlalchemy import cast, type_coerce
        from sqlalchemy import String, JSON
        import json

        cast(
            data_table.c.data['some_key'], String
        ) == json.dumps({"foo": "bar"})

        cast(
            data_table.c.data['some_key'], String
        ) == type_coerce({"foo": "bar"}, JSON)

    The :class:`.JSON` type, when used with the SQLAlchemy ORM, does not
    detect in-place mutations to the structure.  In order to detect these, the
    :mod:`sqlalchemy.ext.mutable` extension must be used.  This extension will
    allow "in-place" changes to the datastructure to produce events which
    will be detected by the unit of work.  See the example at :class:`.HSTORE`
    for a simple example involving a dictionary.

    When working with NULL values, the :class:`.JSON` type recommends the
    use of two specific constants in order to differentiate between a column
    that evaluates to SQL NULL, e.g. no value, vs. the JSON-encoded string
    of ``"null"``.   To insert or select against a value that is SQL NULL,
    use the constant :func:`.null`::

        from sqlalchemy import null
        conn.execute(table.insert(), json_value=null())

    To insert or select against a value that is JSON ``"null"``, use the
    constant :attr:`.JSON.NULL`::

        conn.execute(table.insert(), json_value=JSON.NULL)

    The :class:`.JSON` type supports a flag
    :paramref:`.JSON.none_as_null` which when set to True will result
    in the Python constant ``None`` evaluating to the value of SQL
    NULL, and when set to False results in the Python constant
    ``None`` evaluating to the value of JSON ``"null"``.    The Python
    value ``None`` may be used in conjunction with either
    :attr:`.JSON.NULL` and :func:`.null` in order to indicate NULL
    values, but care must be taken as to the value of the
    :paramref:`.JSON.none_as_null` in these cases.

    .. seealso::

        :class:`.postgresql.JSON`

        :class:`.postgresql.JSONB`

        :class:`.mysql.JSON`

    .. versionadded:: 1.1


    R5t	JSON_NULLcCs
||_dS(sConstruct a :class:`.types.JSON` type.

        :param none_as_null=False: if True, persist the value ``None`` as a
         SQL NULL value, not the JSON encoding of ``null``.   Note that
         when this flag is False, the :func:`.null` construct can still
         be used to persist a NULL value::

             from sqlalchemy import null
             conn.execute(table.insert(), data=null())

         .. note::

              :paramref:`.JSON.none_as_null` does **not** apply to the
              values passed to :paramref:`.Column.default` and
              :paramref:`.Column.server_default`; a value of ``None``
              passed for these parameters means "no default present".

         .. seealso::

              :attr:`.types.JSON.NULL`

         N(tnone_as_null(RR7((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF5stJSONElementTypecBsDeZdZe�Ze�Zd�Zd�Zd�Z	d�Z
RS(s?common function for index / path elements in a JSON expression.cCs|jj|�S(N(t_stringt_cached_bind_processor(RRM((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytstring_bind_processorTscCs|jj|�S(N(R9t_cached_literal_processor(RRM((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytstring_literal_processorWscs7|jj|��|j|����fd�}|S(NcsO�r$t|t�r$�|�}n'�rKt|tj�rK�|�}n|S(N(R-R|RR�(RL(t
int_processortstring_processor(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN^s
(t_integerR:R;(RRMRN((R>R?sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZZscs7|jj|��|j|����fd�}|S(NcsO�r$t|t�r$�|�}n'�rKt|tj�rK�|�}n|S(N(R-R|RR�(RL(R>R?(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRNks
(R@R<R=(RRMRN((R>R?sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyROgs(R%R&R(RyR@R:R9R;R=RZRO(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR8Ns					
t
JSONIndexTypecBseZdZRS(s�Placeholder for the datatype of a JSON index value.

        This allows execution-time processing of JSON index values
        for special syntaxes.

        (R%R&R((((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRAtstJSONPathTypecBseZdZRS(s�Placeholder type for JSON path operations.

        This allows execution-time processing of a path-based
        index value into a specific SQL syntax.

        (R%R&R((((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRB|sRcBs&eZdZejd�d��ZRS(s6Define comparison operations for :class:`.types.JSON`.s!sqlalchemy.sql.default_comparatorcCs�t|tj�rXt|tjj�rX|j|jtj	|dt
j�}tj	}n-|j|jtj|dt
j
�}tj}|||jfS(Ntbindparam_type(R-RR�Rtcollections_abctSequencet_check_literalR0Rtjson_path_getitem_opR5RBtjson_getitem_opRAR(Rtdefault_comparatorR3toperator((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR4�s	(R%R&R(RRR4(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�scCstS(N(R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf�scCs|jS(s#Alias of :attr:`.JSON.none_as_null`(R7(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytshould_evaluate_none�scCs||_dS(N(R7(RRL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRK�scCs
tdt�S(NRC(R:R](R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt	_str_impl�scs=�jj|��|jp!tj����fd�}|S(Ncsh|�jkrd}n+t|tj�s?|dkrC�jrCdS�|�}�rd�|�}n|S(N(tNULLR?R-RtNullR7(RLt
serialized(tjson_serializerRtstring_process(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s	(RLRZt_json_serializertjsonR(RRMRN((RPRRQsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRZ�s
cs=|jj||��|jp$tj���fd�}|S(Ncs/|dkrdS�r%�|�}n�|�S(N(R?(RL(tjson_deserializerRQ(sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�s
(RLRdt_json_deserializerRSR(RRMR`RN((RTRQsJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRd�s(R%R&R(RmRothashableRtsymbolRMRFRR8RARBR2RR+R*R)RfRKtsetterR�RLRZRd(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR5xs �)&	tARRAYcBs�eZdZdZeZdejejfd��YZeZ	ed
ed�Zed��Z
ed��Zd�Zd�Zd	�ZRS(s�
Represent a SQL Array type.

    .. note::  This type serves as the basis for all ARRAY operations.
       However, currently **only the PostgreSQL backend has support
       for SQL arrays in SQLAlchemy**.  It is recommended to use the
       :class:`.postgresql.ARRAY` type directly when using ARRAY types
       with PostgreSQL, as it provides additional operators specific
       to that backend.

    :class:`.types.ARRAY` is part of the Core in support of various SQL
    standard functions such as :class:`.array_agg` which explicitly involve
    arrays; however, with the exception of the PostgreSQL backend and possibly
    some third-party dialects, no other SQLAlchemy built-in dialect has support
    for this type.

    An :class:`.types.ARRAY` type is constructed given the "type"
    of element::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer))
            )

    The above type represents an N-dimensional array,
    meaning a supporting backend such as PostgreSQL will interpret values
    with any number of dimensions automatically.   To produce an INSERT
    construct that passes in a 1-dimensional array of integers::

        connection.execute(
                mytable.insert(),
                data=[1,2,3]
        )

    The :class:`.types.ARRAY` type can be constructed given a fixed number
    of dimensions::

        mytable = Table("mytable", metadata,
                Column("data", ARRAY(Integer, dimensions=2))
            )

    Sending a number of dimensions is optional, but recommended if the
    datatype is to represent arrays of more than one dimension.  This number
    is used:

    * When emitting the type declaration itself to the database, e.g.
      ``INTEGER[][]``

    * When translating Python values to database values, and vice versa, e.g.
      an ARRAY of :class:`.Unicode` objects uses this number to efficiently
      access the string values inside of array structures without resorting
      to per-row type inspection

    * When used with the Python ``getitem`` accessor, the number of dimensions
      serves to define the kind of type that the ``[]`` operator should
      return, e.g. for an ARRAY of INTEGER with two dimensions::

          >>> expr = table.c.column[5]  # returns ARRAY(Integer, dimensions=1)
          >>> expr = expr[6]  # returns Integer

    For 1-dimensional arrays, an :class:`.types.ARRAY` instance with no
    dimension parameter will generally assume single-dimensional behaviors.

    SQL expressions of type :class:`.types.ARRAY` have support for "index" and
    "slice" behavior.  The Python ``[]`` operator works normally here, given
    integer indexes or slices.  Arrays default to 1-based indexing.
    The operator produces binary expression
    constructs which will produce the appropriate SQL, both for
    SELECT statements::

        select([mytable.c.data[5], mytable.c.data[2:7]])

    as well as UPDATE statements when the :meth:`.Update.values` method
    is used::

        mytable.update().values({
            mytable.c.data[5]: 7,
            mytable.c.data[2:7]: [1, 2, 3]
        })

    The :class:`.types.ARRAY` type also provides for the operators
    :meth:`.types.ARRAY.Comparator.any` and
    :meth:`.types.ARRAY.Comparator.all`. The PostgreSQL-specific version of
    :class:`.types.ARRAY` also provides additional operators.

    .. versionadded:: 1.1.0

    .. seealso::

        :class:`.postgresql.ARRAY`

    RYRcBsVeZdZd�Zd�Zejd�dd��Zejd�dd��Z	RS(s�Define comparison operations for :class:`.types.ARRAY`.

        More operators are available on the dialect-specific form
        of this type.  See :class:`.postgresql.ARRAY.Comparator`.

        c	CsGt|t�r�|j}|jjrJt|jd|jd|j�}ntt|jd|j	j
dtj�t|jd|j	j
dtj�t|jd|j	j
dtj��}n~|jjr�|d7}n|jj
dks�|jj
dkr|jj}n2i|jj
dd6}|jj|jj|�}tj||fS(NiR�ttype_t
dimensions(R-tsliceRtzero_indexeststarttstoptstepRRR0tkeyRtINTEGERTYPER[R?t	item_typeR�R~Rtgetitem(RR3treturn_typetadapt_kw((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR4?	s2	&					
$	cOstd��dS(NsdARRAY.contains() not implemented for the base ARRAY type; please use the dialect-specific ARRAY type(R(RR�R�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytcontainsb	sssqlalchemy.sql.elementscCs:|r|ntj}||j|�|jj|j��S(sReturn ``other operator ANY (array)`` clause.

            Argument places are switched, because ANY requires array
            expression to be on the right hand-side.

            E.g.::

                from sqlalchemy.sql import operators

                conn.execute(
                    select([table.c.data]).where(
                            table.c.data.any(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :func:`.sql.expression.any_`

                :meth:`.types.ARRAY.Comparator.all`

            (RteqRtCollectionAggregatet_create_anyR0(RRtotherRJ((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytanyh	scCs:|r|ntj}||j|�|jj|j��S(sReturn ``other operator ALL (array)`` clause.

            Argument places are switched, because ALL requires array
            expression to be on the right hand-side.

            E.g.::

                from sqlalchemy.sql import operators

                conn.execute(
                    select([table.c.data]).where(
                            table.c.data.all(7, operator=operators.lt)
                        )
                )

            :param other: expression to be compared
            :param operator: an operator object from the
             :mod:`sqlalchemy.sql.operators`
             package, defaults to :func:`.operators.eq`.

            .. seealso::

                :func:`.sql.expression.all_`

                :meth:`.types.ARRAY.Comparator.any`

            (RRhRRit_create_allR0(RRRkRJ((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pytall�	sN(
R%R&R(R4RgRRR?RlRn(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR6	s	#	"cCsat|t�rtd��nt|t�r9|�}n||_||_||_||_dS(s�Construct an :class:`.types.ARRAY`.

        E.g.::

          Column('myarray', ARRAY(Integer))

        Arguments are:

        :param item_type: The data type of items of this array. Note that
          dimensionality is irrelevant here, so multi-dimensional arrays like
          ``INTEGER[][]``, are constructed as ``ARRAY(Integer)``, not as
          ``ARRAY(ARRAY(Integer))`` or such.

        :param as_tuple=False: Specify whether return results
          should be converted to tuples from lists.  This parameter is
          not generally needed as a Python list corresponds well
          to a SQL array.

        :param dimensions: if non-None, the ARRAY will assume a fixed
         number of dimensions.   This impacts how the array is declared
         on the database, how it goes about interpreting Python and
         result values, as well as how expression behavior in conjunction
         with the "getitem" operator works.  See the description at
         :class:`.types.ARRAY` for additional detail.

        :param zero_indexes=False: when True, index values will be converted
         between Python zero-based and SQL one-based indexes, e.g.
         a value of one will be added to all index values before passing
         to the database.

        sUDo not nest ARRAY types; ARRAY(basetype) handles multi-dimensional arrays of basetypeN(R-RYR%RRctas_tupleR[R](RRcRoR[R]((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF�	s"			cCs|jS(N(Ro(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRV�	scCstS(N(R�(R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRf�	scCs
||kS(N((RR�R((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�	scCs)t|jt�r%|jj|�ndS(sSupport SchemaEventTargetN(R-RcRR�(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��	scCs?tt|�j|�t|jt�r;|jj|�ndS(sSupport SchemaEventTargetN(R1RYt_set_parent_with_dispatchR-RcR(Rtparent((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRp�	sN(R%R&R(RmRoR]R2RR+R*R?RFR)RVRfRR�Rp(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRY�sZx-		tREALcBseZdZdZRS(sThe SQL REAL type.Rr(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRr�	stFLOATcBseZdZdZRS(sThe SQL FLOAT type.Rs(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRs�	stNUMERICcBseZdZdZRS(sThe SQL NUMERIC type.Rt(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRt
stDECIMALcBseZdZdZRS(sThe SQL DECIMAL type.Ru(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRu
stINTEGERcBseZdZdZRS(sThe SQL INT or INTEGER type.Rv(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRv
stSMALLINTcBseZdZdZRS(sThe SQL SMALLINT type.Rw(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRw
stBIGINTcBseZdZdZRS(sThe SQL BIGINT type.Rx(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRx%
st	TIMESTAMPcBs)eZdZdZed�Zd�ZRS(sThe SQL TIMESTAMP type.

    :class:`~.types.TIMESTAMP` datatypes have support for timezone
    storage on some backends, such as PostgreSQL and Oracle.  Use the
    :paramref:`~types.TIMESTAMP.timezone` argument in order to enable
    "TIMESTAMP WITH TIMEZONE" for these backends.

    RycCstt|�jd|�dS(sgConstruct a new :class:`.TIMESTAMP`.

        :param timezone: boolean.  Indicates that the TIMESTAMP type should
         enable timezone support, if available on the target database.
         On a per-dialect basis is similar to "TIMESTAMP WITH TIMEZONE".
         If the target database does not support timezones, this flag is
         ignored.


        R�N(R1RyRF(RR�((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRF9
scCs|jS(N(Ry(RRh((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRiF
s(R%R&R(RmRoRFRi(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRy,
s	
R�cBseZdZdZRS(sThe SQL DATETIME type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�J
stDATEcBseZdZdZRS(sThe SQL DATE type.Rz(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRzQ
stTIMEcBseZdZdZRS(sThe SQL TIME type.R{(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR{X
stTEXTcBseZdZdZRS(sThe SQL TEXT type.R|(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR|_
stCLOBcBseZdZdZRS(sCThe CLOB type.

    This type is found in Oracle and Informix.
    R}(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR}f
stVARCHARcBseZdZdZRS(sThe SQL VARCHAR type.R~(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR~p
stNVARCHARcBseZdZdZRS(sThe SQL NVARCHAR type.R(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRw
stCHARcBseZdZdZRS(sThe SQL CHAR type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�~
stNCHARcBseZdZdZRS(sThe SQL NCHAR type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
stBLOBcBseZdZdZRS(sThe SQL BLOB type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
sR�cBseZdZdZRS(sThe SQL BINARY type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
st	VARBINARYcBseZdZdZRS(sThe SQL VARBINARY type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
stBOOLEANcBseZdZdZRS(sThe SQL BOOLEAN type.R�(R%R&R(Rm(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
sR.cBsHeZdZdZeZeZd�Zde	j
fd��YZ
e
ZRS(s�An unknown type.

    :class:`.NullType` is used as a default type for those cases where
    a type cannot be determined, including:

    * During table reflection, when the type of a column is not recognized
      by the :class:`.Dialect`
    * When constructing SQL expressions using plain Python objects of
      unknown types (e.g. ``somecolumn == my_special_object``)
    * When a new :class:`.Column` is created, and the given type is passed
      as ``None`` or is not passed at all.

    The :class:`.NullType` can be used within SQL expression invocation
    without issue, it just has no behavior either at the expression
    construction level or at the bind-parameter/result processing level.
    :class:`.NullType` will result in a :exc:`.CompileError` if the compiler
    is asked to render the type itself, such as if it is used in a
    :func:`.cast` operation or within a schema creation operation such as that
    invoked by :meth:`.MetaData.create_all` or the :class:`.CreateTable`
    construct.

    tnullcCs
d�}|S(NcSsdS(NRM((RL((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRN�
s((RRMRN((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyRO�
s	RcBseZd�ZRS(cCsFt|tj�s"tj|�r2||jjfS|j||�SdS(N(R-R.RRtis_commutativeR0RR$(RR R!((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR$�
s
(R%R&R$(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR�
s(R%R&R(RmR]t_isnullRoRVRORRR*(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR.�
s		t	MatchTypecBseZdZRS(sDRefers to the return type of the MATCH operator.

    As the :meth:`.ColumnOperators.match` is probably the most open-ended
    operator in generic SQLAlchemy Core, we can't assume the return type
    at SQL evaluation time, as MySQL returns a floating point, not a boolean,
    and other backends might do something different.    So this type
    acts as a placeholder, currently subclassing :class:`.Boolean`.
    The type allows dialects to inject result-processing functionality
    if needed, and on MySQL will return floating-point values.

    .. versionadded:: 1.0.0

    (R%R&R((((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyR��
s
cCsstt|�t�}|tkrktj|t�}|dk	rg|jtjkrgtj	d|��nt
S|SdS(Ns-Object %r is not legal as a SQL literal value(t
_type_map_getRRoRtinspectR?R~t_registrarsRR@tNULLTYPE(RLt_result_typetinsp((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt_resolve_value_to_types(mR(RWR�R�R�RStRRRtbaseRRRRRRR	RR
RRR
RRRRRRRRRR�R�tobjectRR+R2R:RqRsRwRyR�R�RR�R�R}R�R�R�tdeprecated_clsR�R�R�RRR/R�R5RYRrRsRtRuRvtINTRwRxRyR�RzR{R|R}R~RR�R�R�R�R�R�R.R�R�tBOOLEANTYPEt
STRINGTYPERbt	MATCHTYPER|R�R"R�R�R�R2tNoneTypet	_type_maptpy3kR�ReRtRR�R�t	INDEXABLER(((sJ/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/sql/sqltypes.pyt<module>
s�	�H (�A7&L	���WrZ�]�%
1