On 8/29/07, Ben Schwarze <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I'm having a problem in using inheritance in combination with multiple
> ForeignKeys.
>
> --------------------------------------------
>
> from elixir import *
>
> metadata.bind = 'sqlite:///mydbname.sqlite'
>
> class A(Entity):
> has_field('name', String)
> using_options(shortnames=True, inheritance='multi',
> polymorphic=True)
>
> class B(A):
> has_many('many_c', of_kind='C', inverse='some_b')
> using_options(shortnames=True, inheritance='multi',
> polymorphic=True)
>
> class C(A):
> belongs_to('some_b', of_kind='B', inverse='many_c')
> using_options(shortnames=True, inheritance='multi',
> polymorphic=True)
>
> create_all()
>
> --------------------------------------
>
> Executing this example it gives me the following error:
>
> sqlalchemy.exceptions.ArgumentError: Can't determine join between
> 'Join object on a b' and 'c'; tables have more than one foreign key
> constraint relationship between them. Please specify the 'onclause' of
> this join explicitly.
>
> How can this problem be solved?
This is obviously a bug in Elixir or SQLAlchemy. Unfortunately I have
no time at the moment to track it down. If you want to help fixing it,
the first step is to translate your example into raw SQLAlchemy code
and see if that works or not.
If it doesn't work, please report it to the SQLAlchemy's list.
Otherwise, report back here, along with your SQLAlchemy code so that I
can figure out what is Elixir doing differently.
--
Gaƫtan de Menten
http://openhex.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---