summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-07-13 08:52:07 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-07-13 08:52:07 +0000
commit54a71805aac3f2dd9c093074f8ff50102a14c5af (patch)
treece5bb2495cc85eb35f5f906958cf55577c49cb1f
parent6335317a423c9533a13d741c673fc45d1f052121 (diff)
Fixed #2591 -- Fixed a problem with inspectdb with psycopg2 (only). Patch from
Gary Wilson. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/db/backends/postgresql_psycopg2/introspection.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py
index aa45fe7db7..41df248068 100644
--- a/django/db/backends/postgresql_psycopg2/introspection.py
+++ b/django/db/backends/postgresql_psycopg2/introspection.py
@@ -31,8 +31,8 @@ def get_relations(cursor, table_name):
relations = {}
for row in cursor.fetchall():
try:
- # row[0] and row[1] are like "{2}", so strip the curly braces.
- relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])
+ # row[0] and row[1] are single-item lists, so grab the single item.
+ relations[int(row[0][0]) - 1] = (int(row[1][0]) - 1, row[2])
except ValueError:
continue
return relations