[sqlalchemy] Re: multiple table inheritance problem

2007-04-04 Thread svilen
> > if u have different attributes for different Content subtypes, > > then that means subclasses and eventualy polymorphism. Or u go > > the single_typee (singletable) way, and put all stuff in Content, > > and just check for presence/absence of some attributes. > > yep I have different attribute

[sqlalchemy] Re: multiple table inheritance problem

2007-04-04 Thread Julien Cigar
svilen wrote: >> Julien Cigar wrote: >> >>> Another quick question, relative to multiple inheritance. >>> Is it common to keep a back reference to the parent class within >>> the child class ? >>> > u mean theclass.__bases__? or what? > > >>> The idea behind this is that I want to b

[sqlalchemy] Re: multiple table inheritance problem

2007-04-03 Thread Michael Bayer
On Apr 3, 2007, at 6:13 AM, Julien Cigar wrote: > > Another quick question, relative to multiple inheritance. > Is it common to keep a back reference to the parent class within the > child class ? sure, any relation() can have a backref. if its buggy with a big inheritance relationship, id b

[sqlalchemy] Re: multiple table inheritance problem

2007-04-03 Thread svilen
> Julien Cigar wrote: > > Another quick question, relative to multiple inheritance. > > Is it common to keep a back reference to the parent class within > > the child class ? u mean theclass.__bases__? or what? > > The idea behind this is that I want to be able to retrieve the > > child from the

[sqlalchemy] Re: multiple table inheritance problem

2007-04-03 Thread Julien Cigar
also, I know that it's not possible under "pure" OO programming, but I wondered if it's dirty to do it like that ? Julien Cigar wrote: > Another quick question, relative to multiple inheritance. > Is it common to keep a back reference to the parent class within the > child class ? > > The idea

[sqlalchemy] Re: multiple table inheritance problem

2007-04-03 Thread Julien Cigar
Another quick question, relative to multiple inheritance. Is it common to keep a back reference to the parent class within the child class ? The idea behind this is that I want to be able to retrieve the child from the parent. For example I have something like: assign_mapper(session.context, c

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Julien
OK it was that ! Thanks On Mon, 2007-04-02 at 12:19 -0400, Michael Bayer wrote: > defintiely do not call flush() on "root_folder", call it for the > session overall. thats probably the issue, since its failing to get > the full set of child objects properly in the flush. > > On Apr 2, 2007

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Michael Bayer
defintiely do not call flush() on "root_folder", call it for the session overall. thats probably the issue, since its failing to get the full set of child objects properly in the flush. On Apr 2, 2007, at 10:44 AM, Julien Cigar wrote: > > Hello, > > I'm playing a bit with Multiple Table Inh

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread Julien Cigar
izekia wrote: > Column('content_id', Integer, ForeignKey('contents.id'), > primary_key=True, nullable=False)) > 'primary_key=True' when you define one already, will work? > > yep, you can have multiple primary_key for one Table() object :) > On Apr 2, 6:44 pm, Julien Cigar <[EMAIL PROTECTED]>

[sqlalchemy] Re: multiple table inheritance problem

2007-04-02 Thread izekia
Column('content_id', Integer, ForeignKey('contents.id'), primary_key=True, nullable=False)) 'primary_key=True' when you define one already, will work? On Apr 2, 6:44 pm, Julien Cigar <[EMAIL PROTECTED]> wrote: > Hello, > > I'm playing a bit with Multiple Table Inheritance (the Non-polymorphic > w