mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #29870 -- Added DurationField introspection for Oracle and PostgreSQL.
Thanks Tim Graham for the review.
This commit is contained in:
@@ -129,6 +129,9 @@ class BaseDatabaseFeatures:
|
||||
# Can the backend introspect an DecimalField, instead of an FloatField?
|
||||
can_introspect_decimal_field = True
|
||||
|
||||
# Can the backend introspect a DurationField, instead of a BigIntegerField?
|
||||
can_introspect_duration_field = True
|
||||
|
||||
# Can the backend introspect an IPAddressField, instead of an CharField?
|
||||
can_introspect_ip_address_field = False
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
supports_date_lookup_using_string = False
|
||||
can_introspect_autofield = True
|
||||
can_introspect_binary_field = False
|
||||
can_introspect_duration_field = False
|
||||
can_introspect_small_integer_field = True
|
||||
can_introspect_positive_integer_field = True
|
||||
introspected_boolean_field_type = 'IntegerField'
|
||||
|
||||
@@ -18,6 +18,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
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',
|
||||
|
||||
@@ -22,6 +22,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
1083: 'TimeField',
|
||||
1114: 'DateTimeField',
|
||||
1184: 'DateTimeField',
|
||||
1186: 'DurationField',
|
||||
1266: 'TimeField',
|
||||
1700: 'DecimalField',
|
||||
2950: 'UUIDField',
|
||||
|
||||
@@ -15,6 +15,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
||||
supports_mixed_date_datetime_comparisons = False
|
||||
autocommits_when_autocommit_is_off = True
|
||||
can_introspect_decimal_field = False
|
||||
can_introspect_duration_field = False
|
||||
can_introspect_positive_integer_field = True
|
||||
can_introspect_small_integer_field = True
|
||||
supports_transactions = True
|
||||
|
||||
Reference in New Issue
Block a user