[sqlalchemy] how to make many-to-many links against the same class with an association table

2010-09-30 Thread Julien Iguchi-Cartigny
Hi, I've two classes CourseSet and CanonicalCourse (with the same parent) which need to be connected in a many-to-many relationship. But these classes are mapped on the same table, thus definition of the association table seems redondant: assoc_course_set_canonical_table = Table(

Re: [sqlalchemy] Self-referential object failed with heritance

2010-09-29 Thread Julien Iguchi-Cartigny
Argh yes you're right. Thank you. Julien. On Tue, Sep 28, 2010 at 11:57 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 28, 2010, at 5:50 PM, Julien Iguchi-Cartigny wrote: Hi, I'm trying to declare a adjacency list as follow: class CourseSet(AbstractContainer):    parent_id

[sqlalchemy] Re: polymorhic_identity not working

2010-09-28 Thread Julien Iguchi-Cartigny
() academic_sessions = session.query(AcademicSession).all() print(academic_sessions) course_sets = session.query(CourseSet).all() print(course_sets) On 27 sep, 23:55, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 27, 2010, at 5:10 PM, Julien Iguchi-Cartigny wrote: But How can i do

Re: [sqlalchemy] Re: polymorhic_identity not working

2010-09-28 Thread Julien Iguchi-Cartigny
/trac/ticket/1931 On Sep 28, 2010, at 12:06 PM, Julien Iguchi-Cartigny wrote: Hello Michael, Sorry I missing something but still trap in this problem. As far as I am: class AbstractContainer(Base,AbstractNamed):    __tablename__ = 'CM_MEMBER_CONTAINER_T'    id = Column('MEMBER_CONTAINER_ID

[sqlalchemy] Self-referential object failed with heritance

2010-09-28 Thread Julien Iguchi-Cartigny
Hi, I'm trying to declare a adjacency list as follow: class CourseSet(AbstractContainer): parent_id = Column('PARENT_COURSE_SET', Integer, ForeignKey('CM_MEMBER_CONTAINER_T.ENTERPRISE_ID')) children = relationship(CourseSet, backref=backref('parent', remote_side=AbstractNamed.eid))

Re: [sqlalchemy] Re: polymorhic_identity not working

2010-09-28 Thread Julien Iguchi-Cartigny
OK working, have an other problem but I will open a new thread about it. Thank you. Julien. On 09/28/2010 09:20 PM, Julien Iguchi-Cartigny wrote: Thank you for your fast reply and bug fix. I will test this tonight. Cheers, Julien. On Tue, Sep 28, 2010 at 6:46 PM, Michael Bayer mike

Re: [sqlalchemy] polymorhic_identity not working

2010-09-27 Thread Julien Iguchi-Cartigny
, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 26, 2010, at 6:38 PM, Julien Iguchi-Cartigny wrote: Hi, I'm trying to use polymorphic_on with several inheritances:    engine = create_engine(        'mysql://xxx:y...@localhost:3306/zzz?charset=utf8use_unicode=0',        pool_recycle=3600

Re: [sqlalchemy] polymorhic_identity not working

2010-09-27 Thread Julien Iguchi-Cartigny
But How can i do ? It seems i need to define the table in AsbtractContainer but every time I've an error about already defined column. Cheers, Julien. On Mon, Sep 27, 2010 at 10:30 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 27, 2010, at 4:21 PM, Julien Iguchi-Cartigny wrote

Re: [sqlalchemy] polymorhic_identity not working

2010-09-27 Thread Julien Iguchi-Cartigny
, Julien Iguchi-Cartigny kart...@gmail.com wrote: But How can i do ? It seems i need to define the table in AsbtractContainer but every time I've an error about already defined column. Cheers, Julien. On Mon, Sep 27, 2010 at 10:30 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Sep 27

[sqlalchemy] polymorhic_identity not working

2010-09-26 Thread Julien Iguchi-Cartigny
Hi, I'm trying to use polymorphic_on with several inheritances: engine = create_engine( 'mysql://xxx:y...@localhost:3306/zzz?charset=utf8use_unicode=0', pool_recycle=3600, echo=True) Base = declarative_base() class AbstractPersistent(object): version =