mirror of
https://github.com/django/django.git
synced 2025-11-18 02:56:45 +00:00
Fixed #36646 -- Added compatibility for oracledb 3.4.0.
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Docs / spelling (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
Docs / lint-docs (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
Some checks failed
Linters / flake8 (push) Has been cancelled
Linters / isort (push) Has been cancelled
Linters / black (push) Has been cancelled
Docs / spelling (push) Has been cancelled
Docs / blacken-docs (push) Has been cancelled
Docs / lint-docs (push) Has been cancelled
Tests / Windows, SQLite, Python 3.13 (push) Has been cancelled
Tests / JavaScript tests (push) Has been cancelled
The Database.Binary, Date, and Timestamp attributes were changed from aliases to bytes, datetime.date, and datetime.datetime to factory functions in oracle/python-oracledb@869a887819 which made their usage inadequate for isinstance checks. Thanks John Wagenleitner for the report and Natalia for the triage. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
parent
1167cd1d63
commit
315dbe675d
4 changed files with 5 additions and 6 deletions
|
|
@ -433,7 +433,7 @@ class OracleParam:
|
|||
param = 0
|
||||
if hasattr(param, "bind_parameter"):
|
||||
self.force_bytes = param.bind_parameter(cursor)
|
||||
elif isinstance(param, (Database.Binary, datetime.timedelta)):
|
||||
elif isinstance(param, (bytes, datetime.timedelta)):
|
||||
self.force_bytes = param
|
||||
else:
|
||||
# To transmit to the database, we need Unicode if supported
|
||||
|
|
|
|||
|
|
@ -273,12 +273,12 @@ END;
|
|||
return value
|
||||
|
||||
def convert_datefield_value(self, value, expression, connection):
|
||||
if isinstance(value, Database.Timestamp):
|
||||
if isinstance(value, datetime.datetime):
|
||||
value = value.date()
|
||||
return value
|
||||
|
||||
def convert_timefield_value(self, value, expression, connection):
|
||||
if isinstance(value, Database.Timestamp):
|
||||
if isinstance(value, datetime.datetime):
|
||||
value = value.time()
|
||||
return value
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class BoundVar:
|
|||
"BooleanField": int,
|
||||
"FloatField": Database.DB_TYPE_BINARY_DOUBLE,
|
||||
"DateTimeField": Database.DB_TYPE_TIMESTAMP,
|
||||
"DateField": Database.Date,
|
||||
"DateField": datetime.date,
|
||||
"DecimalField": decimal.Decimal,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,5 +9,4 @@ Django 5.2.8 fixes several bugs in 5.2.7.
|
|||
Bugfixes
|
||||
========
|
||||
|
||||
* ...
|
||||
|
||||
* Added compatibility for ``oracledb`` 3.4.0 (:ticket:`36646`).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue