... しています。 from django.contrib.postgres.constraints import ExclusionConstraint from django.contrib.postgres.fields import DateTimeRangeField , RangeOperators from django.db import models from django.db.models import Q class Room ( models . Model ): number = model ... d () class Reservation ( models . Model ): room = models . ForeignKey ( "Room" , on_delete = models . CASCADE ) timespan = DateTimeRangeField () cancelled = models . BooleanField ( default = False ) class Meta : constraints = [ ExclusionConstraint ( name = "exclud ... 。たとえば: from django.contrib.postgres.constraints import ExclusionConstraint from django.contrib.postgres.fields import ( DateTimeRangeField , RangeBoundary , RangeOperators , ) from django.db import models from django.db.models import Func , Q class TsTzRange ( ... ... いて、その入力を django.db.backends.postgresql.psycopg_any.NumericRange に変換します。 DecimalRangeField のデフォルトです。 DateTimeRangeField class DateTimeRangeField DateTimeField クラスに基づいて、その入力を django.db.backends.postgresql.psycopg_any.DateTimeTZRa ... nge に変換します。これは DateTimeRangeField のデフォルトです。 DateRangeField class DateRangeField DateField に基づいて、その入力を django.db.backends.postgresql.psyc ... ... in return UTF-8 bytestrings on Python 2 if the input is a bytestring ( #25720 ). Fixed serialization of DateRangeField and DateTimeRangeField ( #24937 ). Fixed the exact lookup of ArrayField ( #25666 ). Fixed Model.refresh_from_db() updating of ForeignKey fields w ... ... #30628 ). Fixed a migration crash on PostgreSQL when adding a check constraint with a contains lookup on DateRangeField or DateTimeRangeField , if the right hand side of an expression is the same type ( #30621 ). Fixed a regression in Django 2.2 where auto-reloade ... ... 含まない [) です ( different bounds の詳細についてはPostgreSQLのドキュメントを参照してください) 。離散範囲でないフィールド ( DateTimeRangeField と DecimalRangeField ) のデフォルトの境界は default_bounds 引数で変更できます。 PostgreSQL は要素を持たない範囲を正規化して ... ント を参照してください)。 default_bounds は django.db.backends.postgresql.psycopg_any.NumericRange 入力には使用されません。 DateTimeRangeField class DateTimeRangeField ( default_bounds = '[)' , ** options ) タイムスタンプの範囲を格納します。 DateTimeField に基づいて ... ... t now supports covering exclusion constraints using SP-GiST indexes on PostgreSQL 14+. The new default_bounds attribute of DateTimeRangeField and DecimalRangeField allows specifying bounds for list and tuple inputs. ExclusionConstraint now allows specifying operat ... ... UT_FORMATS setting DateTimeField (django.db.models のクラス) (django.forms のクラス) DateTimeInput (django.forms のクラス) DateTimeRangeField (django.contrib.postgres.fields のクラス) (django.contrib.postgres.forms のクラス) datetimes() (django.db.models.query.Que ... default (AppConfig の属性) (Field の属性) DEFAULT_AUTO_FIELD setting default_auto_field (AppConfig の属性) default_bounds (DateTimeRangeField の属性) (DecimalRangeField の属性) DEFAULT_CHARSET setting DEFAULT_EXCEPTION_REPORTER setting DEFAULT_EXCEPTION_REPORTER_F ... 2026年10月08日