ó
H`¾Tc           @   s$  d  d l  m Z d d l m Z d Z d e f d „  ƒ  YZ d e e j f d	 „  ƒ  YZ	 e	 e d
 <d e e j f d „  ƒ  YZ
 e
 e d <d e e j f d „  ƒ  YZ e e d <d e e j f d „  ƒ  YZ e e d <d e e j f d „  ƒ  YZ e e d <d e e j f d „  ƒ  YZ e e d <d S(   i   (   t   ischema_namesi   (   t   typest	   INT4RANGEt	   INT8RANGEt   NUMRANGEt   RangeOperatorsc           B   s*   e  Z d  Z d e j j f d „  ƒ  YZ RS(   s  
    This mixin provides functionality for the Range Operators
    listed in Table 9-44 of the `postgres documentation`__ for Range
    Functions and Operators. It is used by all the range types
    provided in the ``postgres`` dialect and can likely be used for
    any range types you create yourself.

    __ http://www.postgresql.org/docs/devel/static/functions-range.html

    No extra support is provided for the Range Functions listed in
    Table 9-45 of the postgres documentation. For these, the normal
    :func:`~sqlalchemy.sql.expression.func` object should be used.

    .. versionadded:: 0.8.2  Support for Postgresql RANGE operations.

    t   comparator_factoryc           B   st   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z e Z d „  Z	 e	 Z
 d „  Z d „  Z d	 „  Z d
 „  Z RS(   s-   Define comparison operations for range types.c         C   s   |  j  j d ƒ | ƒ S(   s<   Boolean expression. Returns true if two ranges are not equals   <>(   t   exprt   op(   t   selft   other(    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   __ne__"   s    c         K   s   |  j  j d ƒ | ƒ S(   s¤   Boolean expression. Returns true if the right hand operand,
            which can be an element or a range, is contained within the
            column.
            s   @>(   R   R   (   R	   R
   t   kw(    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   contains&   s    c         C   s   |  j  j d ƒ | ƒ S(   ss   Boolean expression. Returns true if the column is contained
            within the right hand operand.
            s   <@(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   contained_by-   s    c         C   s   |  j  j d ƒ | ƒ S(   s„   Boolean expression. Returns true if the column overlaps
            (has points in common with) the right hand operand.
            s   &&(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   overlaps3   s    c         C   s   |  j  j d ƒ | ƒ S(   ss   Boolean expression. Returns true if the column is strictly
            left of the right hand operand.
            s   <<(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   strictly_left_of9   s    c         C   s   |  j  j d ƒ | ƒ S(   st   Boolean expression. Returns true if the column is strictly
            right of the right hand operand.
            s   >>(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   strictly_right_ofA   s    c         C   s   |  j  j d ƒ | ƒ S(   s‡   Boolean expression. Returns true if the range in the column
            does not extend right of the range in the operand.
            s   &<(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   not_extend_right_ofI   s    c         C   s   |  j  j d ƒ | ƒ S(   s†   Boolean expression. Returns true if the range in the column
            does not extend left of the range in the operand.
            s   &>(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   not_extend_left_ofO   s    c         C   s   |  j  j d ƒ | ƒ S(   s}   Boolean expression. Returns true if the range in the column
            is adjacent to the range in the operand.
            s   -|-(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   adjacent_toU   s    c         C   s   |  j  j d ƒ | ƒ S(   sœ   Range expression. Returns the union of the two ranges.
            Will raise an exception if the resulting range is not
            contigous.
            t   +(   R   R   (   R	   R
   (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   __add__[   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R   t
   __lshift__R   t
   __rshift__R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR      s   									(   R   R   R   t   sqltypest   Concatenablet
   ComparatorR   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR      s   c           B   s   e  Z d  Z d Z RS(   sK   Represent the Postgresql INT4RANGE type.

    .. versionadded:: 0.8.2

    R   (   R   R   R   t   __visit_name__(    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR   c   s   t	   int4rangec           B   s   e  Z d  Z d Z RS(   sK   Represent the Postgresql INT8RANGE type.

    .. versionadded:: 0.8.2

    R   (   R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR   o   s   t	   int8rangec           B   s   e  Z d  Z d Z RS(   sJ   Represent the Postgresql NUMRANGE type.

    .. versionadded:: 0.8.2

    R   (   R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR   {   s   t   numranget	   DATERANGEc           B   s   e  Z d  Z d Z RS(   sK   Represent the Postgresql DATERANGE type.

    .. versionadded:: 0.8.2

    R#   (   R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR#   ‡   s   t	   dateranget   TSRANGEc           B   s   e  Z d  Z d Z RS(   sI   Represent the Postgresql TSRANGE type.

    .. versionadded:: 0.8.2

    R%   (   R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR%   “   s   t   tsranget	   TSTZRANGEc           B   s   e  Z d  Z d Z RS(   sK   Represent the Postgresql TSTZRANGE type.

    .. versionadded:: 0.8.2

    R'   (   R   R   R   R   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyR'   Ÿ   s   t	   tstzrangeN(   s	   INT4RANGEs	   INT8RANGEs   NUMRANGE(   t   baseR    t    R   R   t   __all__t   objectR   t
   TypeEngineR   R   R   R#   R%   R'   (    (    (    sk   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.pyt   <module>   s   V	
	
	
	
	
	