ó
H`¾Tc           @   s:   d  d l  m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   ColumnCollectionConstraint(   t
   expressiont   ExcludeConstraintc           B   s,   e  Z d  Z d Z d Z d „  Z d „  Z RS(   sÜ   A table-level EXCLUDE constraint.

    Defines an EXCLUDE constraint as described in the `postgres
    documentation`__.

    __ http://www.postgresql.org/docs/9.0/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE
    t   exclude_constraintc         O   sØ   t  j |  d | j d ƒ d | j d ƒ d | j d ƒ g  | D] \ } } | ^ q= Œi  |  _ x3 | D]+ \ } } t | d | ƒ } | |  j | <qf W| j d d ƒ |  _ | j d ƒ } | rÔ t j | ƒ |  _ n  d S(   su  
        :param \*elements:
          A sequence of two tuples of the form ``(column, operator)`` where
          column must be a column name or Column object and operator must
          be a string containing the operator to use.

        :param name:
          Optional, the in-database name of this constraint.

        :param deferrable:
          Optional bool.  If set, emit DEFERRABLE or NOT DEFERRABLE when
          issuing DDL for this constraint.

        :param initially:
          Optional string.  If set, emit INITIALLY <value> when issuing DDL
          for this constraint.

        :param using:
          Optional string.  If set, emit USING <index_method> when issuing DDL
          for this constraint. Defaults to 'gist'.

        :param where:
          Optional string.  If set, emit WHERE <predicate> when issuing DDL
          for this constraint.

        t   namet
   deferrablet	   initiallyt   usingt   gistt   whereN(	   R    t   __init__t   gett	   operatorst   getattrR   R   t   _literal_as_textR	   (   t   selft   elementst   kwt   colt   opt   col_or_stringR   R	   (    (    sp   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/constraints.pyR
      s    ,	c         K   sp   g  |  j  j ƒ  D] } | |  j | f ^ q } |  j d |  j d |  j d |  j | Œ } | j j |  j ƒ | S(   NR   R   R   (	   t   columnst   keysR   t	   __class__R   R   R   t   dispatcht   _update(   R   R   R   R   t   c(    (    sp   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/constraints.pyt   copyC   s    ,			N(   t   __name__t
   __module__t   __doc__t   __visit_name__t   NoneR	   R
   R   (    (    (    sp   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/constraints.pyR   
   s
   	+N(   t   sqlalchemy.schemaR    t   sqlalchemy.sqlR   R   (    (    (    sp   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/constraints.pyt   <module>   s   