Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #2591 -- Fixed a problem with inspectdb with psycopg2 (only). P…

…atch from

Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 54a71805aac3f2dd9c093074f8ff50102a14c5af 1 parent 6335317
Malcolm Tredinnick authored July 13, 2007
4  django/db/backends/postgresql_psycopg2/introspection.py
@@ -31,8 +31,8 @@ def get_relations(cursor, table_name):
31 31
     relations = {}
32 32
     for row in cursor.fetchall():
33 33
         try:
34  
-            # row[0] and row[1] are like "{2}", so strip the curly braces.
35  
-            relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])
  34
+            # row[0] and row[1] are single-item lists, so grab the single item.
  35
+            relations[int(row[0][0]) - 1] = (int(row[1][0]) - 1, row[2])
36 36
         except ValueError:
37 37
             continue
38 38
     return relations

0 notes on commit 54a7180

Please sign in to comment.
Something went wrong with that request. Please try again.