I'm trying to find the min/max of a collection off a foreign key. I know that you can do
func.max, but is there a way that lets me use the standard ORM relationship stuff?
For example with a blog, if I wanted to find the biggest "number comment" for a given post given the schema below, is it possible to do something like
class Post(base): id = Column(Integer, primary_key=True) number_comments = relationship("NumberComment") class NumberComment(base): id = Column(Integer, primary_key=True) num = Column(Integer, nullable=False)