summaryrefslogtreecommitdiff
path: root/django/db/backends/oracle/introspection.py
diff options
context:
space:
mode:
authorAnton Samarchyan <anton.samarchyan@savoirfairelinux.com>2017-01-24 18:04:12 -0500
committerTim Graham <timograham@gmail.com>2017-02-28 09:17:27 -0500
commit60e52a047e55bc4cd5a93a8bd4d07baed27e9a22 (patch)
tree010a363968b1ed41adf2e64c98d572d7148a2a5e /django/db/backends/oracle/introspection.py
parentd6e26e5b7c8063c2cc5aa045edea6555bf358fc2 (diff)
downloaddjango-60e52a047e55bc4cd5a93a8bd4d07baed27e9a22.tar.gz
Refs #27656 -- Updated django.db docstring verbs according to PEP 257.
Diffstat (limited to 'django/db/backends/oracle/introspection.py')
-rw-r--r--django/db/backends/oracle/introspection.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index be6032180a..dd56252ef3 100644
--- a/django/db/backends/oracle/introspection.py
+++ b/django/db/backends/oracle/introspection.py
@@ -44,15 +44,16 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
return super().get_field_type(data_type, description)
def get_table_list(self, cursor):
- """
- Returns a list of table and view names in the current database.
- """
+ """Return a list of table and view names in the current database."""
cursor.execute("SELECT TABLE_NAME, 't' FROM USER_TABLES UNION ALL "
"SELECT VIEW_NAME, 'v' FROM USER_VIEWS")
return [TableInfo(row[0].lower(), row[1]) for row in cursor.fetchall()]
def get_table_description(self, cursor, table_name):
- "Returns a description of the table, with the DB-API cursor.description interface."
+ """
+ Return a description of the table with the DB-API cursor.description
+ interface.
+ """
# user_tab_columns gives data default for columns
cursor.execute("""
SELECT
@@ -81,19 +82,19 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
return description
def table_name_converter(self, name):
- "Table name comparison is case insensitive under Oracle"
+ """Table name comparison is case insensitive under Oracle."""
return name.lower()
def _name_to_index(self, cursor, table_name):
"""
- Returns a dictionary of {field_name: field_index} for the given table.
+ Return a dictionary of {field_name: field_index} for the given table.
Indexes are 0-based.
"""
return {d[0]: i for i, d in enumerate(self.get_table_description(cursor, table_name))}
def get_relations(self, cursor, table_name):
"""
- Returns a dictionary of {field_name: (field_name_other_table, other_table)}
+ Return a dictionary of {field_name: (field_name_other_table, other_table)}
representing all relationships to the given table.
"""
table_name = table_name.upper()
@@ -164,7 +165,8 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
def get_constraints(self, cursor, table_name):
"""
- Retrieves any constraints or keys (unique, pk, fk, check, index) across one or more columns.
+ Retrieve any constraints or keys (unique, pk, fk, check, index) across
+ one or more columns.
"""
constraints = {}
# Loop over the constraints, getting PKs, uniques, and checks