diff options
| author | Mads Jensen <mje@inducks.org> | 2019-07-12 13:08:00 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-07-16 18:04:41 +0200 |
| commit | a3417282ac0464a9a2d1d7685bcfef10feed2597 (patch) | |
| tree | a041b9f3f50c7199c0574c66fb185f0337831cf9 /tests/postgres_tests/models.py | |
| parent | 7174cf0b009711c41e5f76f6c0c68137898716a0 (diff) | |
Fixed #29824 -- Added support for database exclusion constraints on PostgreSQL.
Thanks to Nick Pope and Mariusz Felisiak for review.
Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'tests/postgres_tests/models.py')
| -rw-r--r-- | tests/postgres_tests/models.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/postgres_tests/models.py b/tests/postgres_tests/models.py index 3d170a9a1a..5b2f41160a 100644 --- a/tests/postgres_tests/models.py +++ b/tests/postgres_tests/models.py @@ -183,3 +183,15 @@ class NowTestModel(models.Model): class UUIDTestModel(models.Model): uuid = models.UUIDField(default=None, null=True) + + +class Room(models.Model): + number = models.IntegerField(unique=True) + + +class HotelReservation(PostgreSQLModel): + room = models.ForeignKey('Room', on_delete=models.CASCADE) + datespan = DateRangeField() + start = models.DateTimeField() + end = models.DateTimeField() + cancelled = models.BooleanField(default=False) |
