-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from hartungstenio/psycopg3
Add compatibility with Psycopg 3
- Loading branch information
Showing
6 changed files
with
54 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
import django | ||
|
||
try: | ||
from django.contrib.postgres.fields import FloatRangeField | ||
from django.contrib.postgres import fields as postgres_fields | ||
|
||
if django.VERSION >= (4, 2): | ||
try: | ||
from psycopg.types.range import DateRange, NumericRange | ||
from psycopg.types.range import TimestamptzRange as DateTimeTZRange | ||
except ImportError: | ||
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange | ||
else: | ||
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange | ||
except ImportError: | ||
FloatRangeField = None | ||
postgres_fields = None | ||
DateRange = None | ||
DateTimeTZRange = None | ||
NumericRange = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
Pillow >= 6.2.1 | ||
pytest-django | ||
pytest-cov | ||
psycopg2-binary | ||
flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters