Fetch A Value Of Sqlalchemy Instrumentedattribute
How can I fetch the value of a InstrumentedAttribute object in SQLalchemy: (Pdb) ResultLine.item_reference_1
Solution 1:
There is no value associated with an InstrumentedAttribute
; you are looking at a table declaration, not a result set. InstrumentedAttribute
is used to define a relationship to another table, for example.
Query the database for results, and the resulting objects will have the reference filled in for you:
for res in session.query(ResultLine).filter(somefilter):
print res.item_reference_1
Post a Comment for "Fetch A Value Of Sqlalchemy Instrumentedattribute"