Answer the question
In order to leave comments, you need to log in
Sqlalchemy get relation for foreignkey
How to get data for a column with a foreignkey on where it looks (better just a relation that is defined)
And just do how to get all defined relations?
for example we have:
class Producer(Base):
__tablename__ = 'b_cat_producers'
id = Column(Integer, primary_key=True, info={"title": "#", "readonly": True, "size": 5})
name = Column(String(255), info={"title": u"Название", "size": 25})
madein_id = Column(Integer, ForeignKey(Country.id))
madein = relationship(Country, primaryjoin="Country.id==Producer.madein_id")
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question