hi,
I'm trying to play with initial_data fixture. I dumpdata (json
format)
and reload it cleanly if there are no foreign key contraints on the
table.
If the tables i'm dumping have foreign keys (in my case holydays/
nation
bith in the same fixture), I
get an error from the db that aborts the transaction and:
1. manage.py loaddata says nothing: worse: says:
[EMAIL PROTECTED]:~/src/django/siti/jobs$ ./manage.py loaddata
ref.json
Loading 'ref' fixtures...
Installing json fixture 'ref' from absolute path.
Installed 112 object(s) from 1 fixture(s)
2. no data is loaded
postgresql log including lat insert going OK
STATEMENT: INSERT INTO
"ref_refholiday"
("date_create","date_last_modify","status","ref_nation_code","day","month","year","name",id)
VALUES ('2007-05-10 17:46:30.980677','2007-05-10 17:46:30.980729','1',
293,'26','12','0','Santo Stefano',33)
LOG: duration: 0.941 ms statement: SELECT
setval('ref_refholiday_id_seq', (SELECT max("id") FROM
"ref_refholiday"));
STATEMENT: SELECT setval('ref_refholiday_id_seq', (SELECT max("id")
FROM "ref_refholiday"));
LOG: duration: 0.578 ms statement: SELECT
setval('ref_refnation_id_seq', (SELECT max("id") FROM
"ref_refnation"));
STATEMENT: SELECT setval('ref_refnation_id_seq', (SELECT max("id")
FROM "ref_refnation"));
ERROR: insert or update on table "ref_refholiday" violates foreign
key constraint "ref_refholiday_ref_nation_code_fkey"
DETAIL: Key (ref_nation_code)=(293) is not present in table
"ref_refnation".
Any hints?
TIA
sandro
*:-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---