forked from Raiza.dev/EliteBot
Cleaned up the directories
This commit is contained in:
parent
f708506d68
commit
a683fcffea
1340 changed files with 554582 additions and 6840 deletions
|
@ -0,0 +1,31 @@
|
|||
def chained_join(*relationships):
|
||||
"""
|
||||
Return a chained Join object for given relationships.
|
||||
"""
|
||||
property_ = relationships[0].property
|
||||
|
||||
if property_.secondary is not None:
|
||||
from_ = property_.secondary.join(
|
||||
property_.mapper.class_.__table__,
|
||||
property_.secondaryjoin
|
||||
)
|
||||
else:
|
||||
from_ = property_.mapper.class_.__table__
|
||||
for relationship in relationships[1:]:
|
||||
prop = relationship.property
|
||||
if prop.secondary is not None:
|
||||
from_ = from_.join(
|
||||
prop.secondary,
|
||||
prop.primaryjoin
|
||||
)
|
||||
|
||||
from_ = from_.join(
|
||||
prop.mapper.class_,
|
||||
prop.secondaryjoin
|
||||
)
|
||||
else:
|
||||
from_ = from_.join(
|
||||
prop.mapper.class_,
|
||||
prop.primaryjoin
|
||||
)
|
||||
return from_
|
Loading…
Add table
Add a link
Reference in a new issue