Re: [sqlalchemy] Declarative: defining relationship and column in one line

2015-05-31 Thread Mike Bayer
On 5/31/15 6:11 AM, Fayaz Yusuf Khan wrote: Hi, On Tuesday, May 19, 2015 at 7:41:45 PM UTC+5:30, Michael Bayer wrote: http://techspot.zzzeek.org/2011/05/17/magic-a-new-orm/ http://techspot.zzzeek.org/2011/05/17/magic-a-new-orm/ I had tried this one before but it looked like those

Re: [sqlalchemy] Declarative: defining relationship and column in one line

2015-05-31 Thread Fayaz Yusuf Khan
Hi, On Tuesday, May 19, 2015 at 7:41:45 PM UTC+5:30, Michael Bayer wrote: http://techspot.zzzeek.org/2011/05/17/magic-a-new-orm/ I had tried this one before but it looked like those columns were never added to the underlying table. -- You received this message because you are subscribed

[sqlalchemy] Declarative: defining relationship and column in one line

2015-05-19 Thread Paul Johnston
Hi, Sorry if this is a FAQ, but is it possible to define a relationship and its column all at once. e.g. instead of: type_id = db.Column(db.Integer, db.ForeignKey('linktype.id')) type = db.relationship('LinkType') Something like: type = db.relationship('LinkType',

Re: [sqlalchemy] Declarative: defining relationship and column in one line

2015-05-19 Thread Mike Bayer
On 5/19/15 6:54 AM, Paul Johnston wrote: Hi, Sorry if this is a FAQ, but is it possible to define a relationship and its column all at once. e.g. instead of: type_id = db.Column(db.Integer, db.ForeignKey('linktype.id')) type = db.relationship('LinkType') Something like: type