On Sat, Dec 11, 2010 at 6:16 AM, Yohann REBATTU
<[email protected]> wrote:
> Hello, i'm trying to use the declarative way (recomanded for
> sqlalchemy 0.5+) to set up a pylons model, and i'm stuck with a pretty
> simple many to many relationship.
>
> The pylons doc ( 
> http://www.sqlalchemy.org/docs/orm/tutorial.html#creating-table-class-and-mapper-all-at-once-declaratively
> ) doesn't describe this kind of relation, but redirect on sqlAlchemy
> doc : ( 
> http://www.sqlalchemy.org/docs/orm/tutorial.html#building-a-many-to-many-relationship
> )
>
> this exemple works well in python console, but as i tryed it inside my
> pylons model ( http://pastebin.com/gtL4Lec9 )
> sqlachemy complain about the group table doesn't exists (maybe
> because, as seen in the doc, the Group object is placed after the
> user_group_table declaration).

Is it possible you put the declarative and non-declarative tables in
different metadatas? Then creating the tables for one metadata
wouldn't create them for the other. Although I'd expect an error when
the mapper is defined because it can't build the relation.

-- 
Mike Orr <[email protected]>

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss?hl=en.

Reply via email to