[sqlalchemy] Many to Many using self-reference in Declarative

2009-04-08 Thread Scripper
Hi, for implementation of a many to many relationship i create a second plain table which contains two columns from the same user table: user_target_table = Table(user_target, metadata, Column('user_id', Integer, ForeignKey('tg_user.user_id')), Column('target_id', Integer,

[sqlalchemy] Re: Mapper with declarative

2009-04-08 Thread Scripper
get it! Problem solved! On 7 Apr., 19:16, J. Cliff Dyer j...@sdf.lonestar.org wrote: On Tue, 2009-04-07 at 06:28 -0700, Scripper wrote: Hello everyone, I have a concrete question about using declarative mapper in my project. When i there appeared some errors. I wonder whether

[sqlalchemy] Mapper with declarative

2009-04-07 Thread Scripper
Hello everyone, I have a concrete question about using declarative mapper in my project. There are three tables: user, services and objects Class Services(Base): user_id = Column(user_id, Integer, ForeignKey (user_table.user_id)) .. Class Objects(Base): user_id =

[sqlalchemy] Mapper with declarative

2009-04-07 Thread Scripper
Hello everyone, I have a concrete question about using declarative mapper in my project. There are three tables: user, services and objects Class Services(Base): user_id = Column(user_id, Integer, ForeignKey (user_table.user_id)) .. Class Objects(Base): user_id =

[sqlalchemy] Mapper with declarative

2009-04-07 Thread Scripper
Hello everyone, I have a concrete question about the declarative mapper in my project. There are three tables: user, services and objects Class Services(Base): mote_id = Column(mote_id, Integer, ForeignKey (mote_table.mote_id)) Class Objects(Base): mote_id = Column(mote_id,

[sqlalchemy] Mapper with declarative

2009-04-07 Thread Scripper
Hello everyone, I have a concrete question about using declarative mapper in my project. There are three tables: user, services and objects Class Services(Base): user_id = Column(user_id, Integer, ForeignKey (user_table.user_id)) .. Class Objects(Base): user_id =

[sqlalchemy] Re: About the mapping for many to many

2008-09-11 Thread scripper
. you may want something like this: item.categories[0].name to access the name of a particular category. On Sep 10, 2:39 pm, Scripper [EMAIL PROTECTED] wrote: I 've created a model with two tables in which the many to many relationship was implemented. Item and Category. I appended two

[sqlalchemy] About the mapping for many to many

2008-09-10 Thread Scripper
I 've created a model with two tables in which the many to many relationship was implemented. Item and Category. I appended two categorys to one item for example. But as i wanted to show the item's attribute category content in the view i got instead some datas below: mosst.model.page.Category