I have found this:
mapper = inspect(test_run)
mapper.primary_key -> attribute does not exist
test_run.__mapper__.primary_key -> exist ,but it contain only test_run.ID,
IDs of objects which are loaded through relationships (lazy='joined') are
missing....what is wrong in my setup?
test_run = session.query(TestRun).filter_by(ID=test_run_id).one()
TestRun class :
class TestRun(Base):
__tablename__ = "TestRun"
ID = Column(BigInteger().with_variant(Integer, "sqlite"), primary_key=True)
IDTestOrderNumber = Column(BigInteger, ForeignKey('B_TestOrderNumber.ID',
onupdate="cascade"))
DeviceType = Column(NVARCHAR(length=100))
Operator = Column(NVARCHAR(length=100))
TestStation = Column(NVARCHAR(length=100))
StartTestTimeStamp = Column(DateTime, default=func.now(get_localzone()))
EndTestTimeStamp = Column(DateTime)
DataModifiedFlag = Column(Boolean)
Location = Column(NVARCHAR(length=100))
OrderNumber = relationship("TestOrderNumber", back_populates="TestRuns",
lazy='joined',
cascade="save-update, merge, delete, expunge")
TestRunToDevs = relationship("TestRunToDev", back_populates="TestRun",
lazy='joined',
cascade="save-update, merge, delete, expunge")
TestEquipments = relationship("TestEquipment", back_populates="testRun",
lazy='joined',
cascade="save-update, merge, delete, expunge")
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.