One way would be to use column-property
to define a computed column which would be populated with the field you need. Below I used a min
value, but you can construct arbitrary query to get the first by ID (best way to achieve that would be backend-specific):
class Part(db.Model):
# ...
date_checked = db.column_property(
db.select([db.func.min(PartHistory.date_checked)]).\
where(PartHistory.part_id==id).\
correlate_except(PartHistory)
)
Note that you might not be able to sort by this column though.