Ticket #2591: 2591.diff

File 2591.diff, 752 bytes (added by Gary Wilson <gary.wilson@…>, 17 years ago)
  • django/db/backends/postgresql_psycopg2/introspection.py

     
    3131    relations = {}
    3232    for row in cursor.fetchall():
    3333        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])
    3636        except ValueError:
    3737            continue
    3838    return relations
Back to Top