IntegrityError - problem still exists in somewhat more complex cyclical relations

Issue #365 resolved
somedood created an issue

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)

  1. Mike Bayer 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.

  2. Log in to comment