[sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-13 Thread c.buhtz
I create a many-to-many relationship between a `Person` (as an _author_) and a `Reference` (as a _scientific publication_). ReferenceAuthor = sa.Table('ReferenceAuthor', _Base.metadata, sa.Column('ReferenceID', sa.Integer, sa.ForeignKey('Reference.ID'), primary_key=True), sa.Column('Perso

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-13 Thread Mike Bayer
On 02/13/2016 12:00 PM, c.bu...@posteo.jp wrote: I create a many-to-many relationship between a `Person` (as an _author_) and a `Reference` (as a _scientific publication_). ReferenceAuthor = sa.Table('ReferenceAuthor', _Base.metadata, sa.Column('ReferenceID', sa.Integer, sa.ForeignKe

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-14 Thread c.buhtz
Hi Mike On 2016-02-13 14:30 Mike Bayer wrote: > you can order by secondary, just add it in: > > authors = relationship("Person", secondary=ReferenceAuthor, > order_by=ReferenceAuthor.c.Index) Are you sure? I get this error about it TypeError: relationship() got an unexpected keyword argument

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-14 Thread Michael Bayer
order_by, you spelled it wrong. > On Feb 14, 2016, at 3:53 AM, wrote: > > Hi Mike > >> On 2016-02-13 14:30 Mike Bayer wrote: >> you can order by secondary, just add it in: >> >> authors = relationship("Person", secondary=ReferenceAuthor, >> order_by=ReferenceAuthor.c.Index) > > Are you sur

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-14 Thread c.buhtz
> >> order_by=ReferenceAuthor.c.Index) >order_by, you spelled it wrong. Sorry, I can not see a difference. I think I missunderstand you. btw: What does the 'c' means? -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this g

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-14 Thread c.buhtz
On 2016-02-14 08:38 Michael Bayer wrote: > order_by, you spelled it wrong. Ah, I see the misstake. Was a copy&paste thing. Sorry. What is this c? I havend found that "topic" in the docs. Where should I look for? -- You received this message because you are subscribed to the Google Groups "sql

Re: [sqlalchemy] Use order_by when using relationship() with secondary-parameter in a many-to-many?

2016-02-14 Thread Michal Petrucha
On Sun, Feb 14, 2016 at 03:23:59PM +0100, c.bu...@posteo.jp wrote: > On 2016-02-14 08:38 Michael Bayer wrote: > > order_by, you spelled it wrong. > > Ah, I see the misstake. Was a copy&paste thing. Sorry. > > What is this c? I havend found that "topic" in the docs. Where should I > look for? I