Hi,
I'm using Elixir with Turbogears.
I have a model which has an object that has a one-to-many and then a
belongs_to to set which of the many is primary:
Person
has_many('addresses', of_kind='Address', inverse='owner')
belongs_to('primary_address', of_kind='Address', use_alter=True)
Address
belongs_to('owner', of_kind='Person', inverse='photos')
I thought that the use_alter=True would prevent circular reference
problems. But, when I try to insert a new address, I get:
File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/site-packages/SQLAlchemy-0.3.10-py2.5.egg/sqlalchemy/
topological.py", line 225, in sort
raise CircularDependencyError("Circular dependency detected " +
repr(edges) + repr(queue))
CircularDependencyError: Circular dependency detected
I _could_ change Address to have a has_field('is_primary', Boolean),
but this would add an extra join and a huge amount of complexity to
some code I have elsewhere, so I'd like to avoid it.
Is there any way I can avoid getting the CircularDependencyError?
Thank you very much--I'm loving SA/Elixir so far.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---