On Sun, 2006-10-15 at 09:52 +0000, a wrote: > I m trying to import these legacy databases into the dbadmin system of > django > thanks for any help > > CREATE TABLE choices > ( > id serial NOT NULL, > poll_id int4 NOT NULL, > choice text, > vote int4 NOT NULL DEFAULT 0, > created timestamp DEFAULT now(), > CONSTRAINT choices_pkey PRIMARY KEY (id), > CONSTRAINT polls_choice_id_fkey FOREIGN KEY (poll_id) > REFERENCES polls (id) MATCH SIMPLE > ON UPDATE NO ACTION ON DELETE NO ACTION > ) > > CREATE TABLE polls > ( > id serial NOT NULL, > question text, > created timestamp DEFAULT now(), > totalvotes int4 DEFAULT 0, > CONSTRAINT polls_pkey PRIMARY KEY (id) > ) > > Please help me out > thanks > > django-admin.py inspectdb --settings=settings > models.py > Traceback (most recent call last): > File "/home/mark/bin/django-admin.py", line 8, in ? > management.execute_from_command_line() > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 1307, in execute_from_command_line > for line in action_mapping[action](): > File "/usr/lib/python2.4/site-packages/django/core/management.py", > line 722, in inspectdb > relations = introspection_module.get_relations(cursor, table_name) > File > "/usr/lib/python2.4/site-packages/django/db/backends/postgresql_psycopg2/introspection.py", > line 35, 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
Normal debugging practices at this point would be to work out what data the program is trying to work with. It isn't getting the data it expects, so what is it getting? Try printing out the "row" element and seeing what it looks like. Compare that output to what it looks like from a simpler table system that works (for example, introspect a database that was created by Django in the first place). Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---