Am Donnerstag, 13. Februar 2014 15:46:31 UTC+1 schrieb Michael Bayer: > > > On Feb 13, 2014, at 6:23 AM, Guido Winkelmann < > gu...@ambient-entertainment.de <javascript:>> wrote: > > > Hi, > > > > Reading through the docs, I could not find out how to tell the > cardinality of an object of type > sqlalchemy.orm.properties.RelationshipProperty, i.e. whether it is > one-to-many, many-to-one or many-to-many. Mostly, I just need to know > whether a relationship refers to just one object or a collection of > objects. > > > > Can someone help me with that? > > So given a class: > > MyClass > > and a relationship at the class level: > > MyClass.some_relationship > > you get at the RelationshipProperty like this: > > MyClass.some_relationship.property >
That doesn't work for me. For some reason, the relationship has the type sqlalchemy.orm.dynamic.AppenderBaseQuery, which has no attribute "property". Maybe that's because I'm using flask-sqlalchemy instead of just sqlalchemy directly? -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/groups/opt_out.