Refs #34233 -- Bumped required cx_Oracle to 8.3.

This bumps minimum supported versions of cx_Oracle to the first release
to support Python 3.10.
This commit is contained in:
Mariusz Felisiak 2023-08-09 12:41:47 +02:00 committed by GitHub
parent 439242c594
commit 80a5667c50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 39 deletions

View File

@ -342,10 +342,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
else: else:
return True return True
@cached_property
def cx_oracle_version(self):
return tuple(int(x) for x in Database.version.split("."))
@cached_property @cached_property
def oracle_version(self): def oracle_version(self):
with self.temporary_connection(): with self.temporary_connection():

View File

@ -6,7 +6,6 @@ from django.db import models
from django.db.backends.base.introspection import BaseDatabaseIntrospection from django.db.backends.base.introspection import BaseDatabaseIntrospection
from django.db.backends.base.introspection import FieldInfo as BaseFieldInfo from django.db.backends.base.introspection import FieldInfo as BaseFieldInfo
from django.db.backends.base.introspection import TableInfo as BaseTableInfo from django.db.backends.base.introspection import TableInfo as BaseTableInfo
from django.utils.functional import cached_property
FieldInfo = namedtuple( FieldInfo = namedtuple(
"FieldInfo", BaseFieldInfo._fields + ("is_autofield", "is_json", "comment") "FieldInfo", BaseFieldInfo._fields + ("is_autofield", "is_json", "comment")
@ -18,25 +17,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
cache_bust_counter = 1 cache_bust_counter = 1
# Maps type objects to Django Field types. # Maps type objects to Django Field types.
@cached_property data_types_reverse = {
def data_types_reverse(self):
if self.connection.cx_oracle_version < (8,):
return {
cx_Oracle.BLOB: "BinaryField",
cx_Oracle.CLOB: "TextField",
cx_Oracle.DATETIME: "DateField",
cx_Oracle.FIXED_CHAR: "CharField",
cx_Oracle.FIXED_NCHAR: "CharField",
cx_Oracle.INTERVAL: "DurationField",
cx_Oracle.NATIVE_FLOAT: "FloatField",
cx_Oracle.NCHAR: "CharField",
cx_Oracle.NCLOB: "TextField",
cx_Oracle.NUMBER: "DecimalField",
cx_Oracle.STRING: "CharField",
cx_Oracle.TIMESTAMP: "DateTimeField",
}
else:
return {
cx_Oracle.DB_TYPE_DATE: "DateField", cx_Oracle.DB_TYPE_DATE: "DateField",
cx_Oracle.DB_TYPE_BINARY_DOUBLE: "FloatField", cx_Oracle.DB_TYPE_BINARY_DOUBLE: "FloatField",
cx_Oracle.DB_TYPE_BLOB: "BinaryField", cx_Oracle.DB_TYPE_BLOB: "BinaryField",

View File

@ -919,7 +919,7 @@ To enable the JSON1 extension you can follow the instruction on
Oracle notes Oracle notes
============ ============
Django supports `Oracle Database Server`_ versions 19c and higher. Version 7.0 Django supports `Oracle Database Server`_ versions 19c and higher. Version 8.3
or higher of the `cx_Oracle`_ Python driver is required. or higher of the `cx_Oracle`_ Python driver is required.
.. _`Oracle Database Server`: https://www.oracle.com/ .. _`Oracle Database Server`: https://www.oracle.com/

View File

@ -571,6 +571,8 @@ Miscellaneous
* The minimum supported version of SQLite is increased from 3.21.0 to 3.27.0. * The minimum supported version of SQLite is increased from 3.21.0 to 3.27.0.
* Support for ``cx_Oracle`` < 8.3 is removed.
.. _deprecated-features-5.0: .. _deprecated-features-5.0:
Features deprecated in 5.0 Features deprecated in 5.0

View File

@ -1 +1 @@
cx_oracle >= 7.0 cx_oracle >= 8.3