diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2013-07-08 10:39:54 +1000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2013-07-08 10:39:54 +1000 |
| commit | 03d9566e0df45c72bffa99fe244a92f0279da56f (patch) | |
| tree | b4c9cc9260769d7f79f62c0fe16a2c5a5746e6ed /django/db/backends/postgresql_psycopg2/introspection.py | |
| parent | 0b69a755029f8a8ba6005b9d77be8132a7bc0fb3 (diff) | |
| download | django-03d9566e0df45c72bffa99fe244a92f0279da56f.tar.gz | |
A large number of stylistic cleanups across django/db/
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/introspection.py')
| -rw-r--r-- | django/db/backends/postgresql_psycopg2/introspection.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py index c334b9d6d0..0ebd3c1ed5 100644 --- a/django/db/backends/postgresql_psycopg2/introspection.py +++ b/django/db/backends/postgresql_psycopg2/introspection.py @@ -25,7 +25,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): 1266: 'TimeField', 1700: 'DecimalField', } - + def get_table_list(self, cursor): "Returns a list of table names in the current database." cursor.execute(""" @@ -47,7 +47,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): WHERE table_name = %s""", [table_name]) null_map = dict(cursor.fetchall()) cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name)) - return [FieldInfo(*((force_text(line[0]),) + line[1:6] + (null_map[force_text(line[0])]=='YES',))) + return [FieldInfo(*((force_text(line[0]),) + line[1:6] + (null_map[force_text(line[0])] == 'YES',))) for line in cursor.description] def get_relations(self, cursor, table_name): @@ -81,7 +81,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): ON ccu.constraint_catalog = tc.constraint_catalog AND ccu.constraint_schema = tc.constraint_schema AND ccu.constraint_name = tc.constraint_name - WHERE kcu.table_name = %s AND tc.constraint_type = 'FOREIGN KEY'""" , [table_name]) + WHERE kcu.table_name = %s AND tc.constraint_type = 'FOREIGN KEY'""", [table_name]) key_columns.extend(cursor.fetchall()) return key_columns |
