Server : Apache System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64 User : dh_edsupp ( 6597262) PHP Version : 8.2.26 Disable Function : NONE Directory : /lib/python3/dist-packages/django/contrib/postgres/__pycache__/ |
Upload File : |
o 3�a� � @ sb d dl mZ d dlmZmZ d dlmZmZmZ d dl m Z d dlmZ dgZ G dd� de �ZdS ) � )�NotSupportedError)� Statement�Table)� Deferrable�F�Q)�BaseConstraint)�Query�ExclusionConstraintc s~ e Zd ZdZdddddd�� fdd� Zdd� Zd d � Zdd� Zd d� Zdd� Z dd� Z � fdd�Z� fdd�Zdd� Z � ZS )r zdCONSTRAINT %(name)s EXCLUDE USING %(index_type)s (%(expressions)s)%(include)s%(where)s%(deferrable)sN� )� index_type� condition� deferrable�include� opclassesc s2 |r|� � dvrtd��|std��tdd� |D ��std��t|td �tf�s,td��|r4|r4td��t|td �tf�sAtd ��t|td �ttf�sOtd ��|r]|r]|� � dkr]td��t|ttf�shtd ��|rvt |�t |�krvtd��|| _ |p|d| _|| _|| _ |r�t|�nd| _|| _t� j|d� d S )N> �gist�spgistz;Exclusion constraints only support GiST or SP-GiST indexes.zFAt least one expression is required to define an exclusion constraint.c s s* � | ]}t |ttf�ot|�d kV qdS )� N)� isinstance�list�tuple�len)�.0�exprr r �E/usr/lib/python3/dist-packages/django/contrib/postgres/constraints.py� <genexpr> s � � �z/ExclusionConstraint.__init__.<locals>.<genexpr>z+The expressions must be a list of 2-tuples.z3ExclusionConstraint.condition must be a Q instance.z7ExclusionConstraint with conditions cannot be deferred.z=ExclusionConstraint.deferrable must be a Deferrable instance.z4ExclusionConstraint.include must be a list or tuple.r z9Covering exclusion constraints only support GiST indexes.z6ExclusionConstraint.opclasses must be a list or tuple.zhExclusionConstraint.expressions and ExclusionConstraint.opclasses must have the same number of elements.�GISTr )�name)�lower� ValueError�allr �typer r r r r �expressionsr r r r r �super�__init__)�selfr r"