On Fri, Feb 4, 2011 at 20:11, Daniel Cristian Cruz
<[email protected]> wrote:
> Hello all.
>
> I had a problem with my model, and here is it (just a bit of it):

[...]

> And here is the test (I put some prints in create_keys):
>
>>>> from model import *
>>>> elixir.metadata.bind = "postgresql+psycopg2://sgn2:sgn2@copernico/senai"
>>>> for item in elixir.entities:
> ...  print item
> ...  elixir.setup_entities([item])

This pattern is not supported. setup_entities only works for
"fully-contained groups of entities". You can't setup one entity at a
time, unless it has no link to any other entity. In other words, you
have to setup all entities which have links to each other in the same
call to setup_entities.

Some cases of entity per entity setup might work if you happen to use
the correct order but you shouldn't rely on that. The usual use case
is setup_all(). And the less usual case is when you have several
independant groups of entities, you can set them up independently by
using setup_entities(the_whole_group). But entity per entity is not a
supported use case.

Hope it helps,
-- 
Gaëtan de Menten

-- 
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.

Reply via email to