#2591: manage.py inspectdb causes exception on postgresql_psycopg2 backend
---------------------------------+------------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: adrian
Type: defect | Status: new
Priority: low | Milestone:
Component: Database wrapper | Version:
Severity: blocker | Keywords:
---------------------------------+------------------------------------------
running ...
{{{
manage.py inspectdb
}}}
cause an exception on postgresql_psycopg2 backend (might be the same to
postgresql).
{{{
class AuthMessage(models.Model):
Traceback (most recent call last):
File "F:\...\manage.py", line 11, in ?
execute_manager(settings)
....
File "F:\...site-packages\django\core\management.py", line 718, in
inspectdb
relations = introspection_module.get_relations(cursor, table_name)
File "F:\...site-
packages\django\db\backends\postgresql_psycopg2\introspection.py", line
36, in get_relations
relations[int(row[0][1:-1]) - 1] = (int(row[1][1:-1]) - 1, row[2])
TypeError: int() argument must be a string or a number
}}}
I fixed this bug by editing line 36 from
{{{
introspection.py:36: relations[int(row[0][1:-1]) - 1] =
(int(row[1][1:-1]) - 1, row[2])
}}}
to ..
{{{
introspection.py:36: relations[int(row[0][0]) - 1] = (int(row[1][0]) -
1, row[2])
}}}
I'am not familiarly with django but it seems to work.
--
Ticket URL: <http://code.djangoproject.com/ticket/2591>
Django <http://code.djangoproject.org/>
The web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---