From 54a71805aac3f2dd9c093074f8ff50102a14c5af Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Fri, 13 Jul 2007 08:52:07 +0000 Subject: [PATCH] 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 --- django/db/backends/postgresql_psycopg2/introspection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/backends/postgresql_psycopg2/introspection.py b/django/db/backends/postgresql_psycopg2/introspection.py index aa45fe7db76..41df248068c 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