- attached test.py
IntegrityError - problem still exists in somewhat more complex cyclical relations
I had posted earlier a problem when getting IntegrityErrors on cyclical relations. That led to bugfix number /ticket/2085 for a fix in the topological module. This fixed the test case, but I have run into the same problem with the attached test which has slightly more complex cyclical relations Let me know any information you may need to clarify the problem. I am attaching the test and the log output. The test is without any use of extensions.
Comments (6)
-
reporter -
reporter - attached sqalog.txt
Log from test case when IntegrityError is raise
-
repo owner yeah, this is more specifically the issue ive seen before. if you notice the raw topological sort, comes up with this:
Mapper|Provider|provider (cycles: [Mapper|Question|question](Mapper|Provider|provider,)) Mapper|ProviderService|provider_service Mapper|Issue|issue (cycles: [Mapper|Question|question](Mapper|Issue|issue,)) Mapper|Answer|answer
which means: Provider is in a circular relationship with Question. Issue is in a separate circular relationship with Question. Its putting the "Question" entry into two different cycles, and is therefore not sorting "Question" against everything else. the second part of this is that when it converts that sort into actual mappers/instances to be processed, it has the Question object in two different places. but the topological has to not do what its doing above.
When ive seen it do this before, its because the mappers themselves were not correctly configured, usually because they had "foreignkey" parameters that were incorrect. but i can see that you dont have any tables dependent on themselves which is the only time "foreignkey" is ever needed, so thats not it.
-
repo owner changeset:2092 has the fix for this. however im going to do another pass on topological.py since its getting impossible to read now.
-
repo owner - changed status to resolved
changeset:2093 has some cleanup. going to mark it fixed.
-
repo owner - removed milestone
Removing milestone: 0.3.2 (automated comment)
- Log in to comment
Test that throws an IntegrityError when saving a single object via the ORM