Author: mtredinnick
Date: 2007-07-13 03:52:07 -0500 (Fri, 13 Jul 2007)
New Revision: 5679
Modified:
django/trunk/django/db/backends/postgresql_psycopg2/introspection.py
Log:
Fixed #2591 -- Fixed a problem with inspectdb with psycopg2 (only). Patch from
Gary Wilson.
Modified: django/trunk/django/db/backends/postgresql_psycopg2/introspection.py
===================================================================
--- django/trunk/django/db/backends/postgresql_psycopg2/introspection.py
2007-07-13 05:03:33 UTC (rev 5678)
+++ django/trunk/django/db/backends/postgresql_psycopg2/introspection.py
2007-07-13 08:52:07 UTC (rev 5679)
@@ -31,8 +31,8 @@
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
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---