[sqlalchemy] How to find one-to-many relations of a class?

2012-12-12 Thread AlexVhr
Hi all. I need to find out if a certain class has one-to-many relations to other classes, and what exactly this classes are. Something like this: *class* *Parent*(Base): __tablename__ = 'parent' id = Column(Integer, primary_key=True) children = relationship(Child) *class*

Re: [sqlalchemy] How to find one-to-many relations of a class?

2012-12-12 Thread AlexVhr
MyClass.children you'll have access to it's children and they will be, one2many relationships On Wed, Dec 12, 2012 at 4:57 AM, AlexVhr vih...@gmail.com javascript:wrote: Hi all. I need to find out if a certain class has one-to-many relations to other classes, and what exactly

Re: [sqlalchemy] How to find one-to-many relations of a class?

2012-12-12 Thread AlexVhr
Thanks a lot, it works perfectly. On a matter of using 0.8 - is it allready stable enough to switch to? (My projects are nothing critical, but still...) On Wednesday, December 12, 2012 6:11:55 PM UTC+2, Michael Bayer wrote: On Dec 12, 2012, at 4:27 AM, AlexVhr wrote: Hi all. I need to find

Re: [sqlalchemy] How to find one-to-many relations of a class?

2012-12-12 Thread AlexVhr
Glad to hear it, I'll give it a try. On Wednesday, December 12, 2012 7:10:49 PM UTC+2, Michael Bayer wrote: yeah 0.8 is fine, was almost ready to put 0.8.0b2 and then final the other day, just little things coming in On Dec 12, 2012, at 11:27 AM, AlexVhr wrote: Thanks a lot, it works

[sqlalchemy] Inheriting a functionality in SQLA

2012-11-20 Thread AlexVhr
I'm trying to incapsulate some functionality (some columns mainly) into base classes to inherit my models from them. The setup looks like this: class EntityTemplate(): @declared_attr def __tablename__(cls): return cls.__name__.lower() id = Column(Integer(),