... . condition ¶ ExclusionConstraint. condition ¶ 行の一部に制約をかける条件を指定する Q オブジェクト。たとえば、 condition=Q(cancelled=False) 。 これらの条件は、 django.db.models.Index.condition と同じデータベースの制約事項を持ちます。 deferrable ¶ Exclusio ... ( models . Model ): room = models . ForeignKey ( "Room" , on_delete = models . CASCADE ) timespan = DateTimeRangeField () cancelled = models . BooleanField ( default = False ) class Meta : constraints = [ ExclusionConstraint ( name = "exclude_overlapping ... ons" , expressions = [ ( "timespan" , RangeOperators . OVERLAPS ), ( "room" , RangeOperators . EQUAL ), ], condition = Q ( cancelled = False ), ), ] モデルが2つのフィールドを使用して範囲を定義する場合、PostgreSQLのネイティブな範囲型ではなく、同等の関数 (例 ... ... . condition ¶ ExclusionConstraint. condition ¶ 行の一部に制約をかける条件を指定する Q オブジェクト。たとえば、 condition=Q(cancelled=False) 。 これらの条件は、 django.db.models.Index.condition と同じデータベースの制約事項を持ちます。 deferrable ¶ Exclusio ... ( models . Model ): room = models . ForeignKey ( "Room" , on_delete = models . CASCADE ) timespan = DateTimeRangeField () cancelled = models . BooleanField ( default = False ) class Meta : constraints = [ ExclusionConstraint ( name = "exclude_overlapping ... ons" , expressions = [ ( "timespan" , RangeOperators . OVERLAPS ), ( "room" , RangeOperators . EQUAL ), ], condition = Q ( cancelled = False ), ), ] モデルが2つのフィールドを使用して範囲を定義する場合、PostgreSQLのネイティブな範囲型ではなく、同等の関数 (例 ... 2026年10月08日