How to filter an sqlalchemy query to all Parents w/o Children, and all Parents, who fall under conditions in a Flask Form

Solution
parents = session.query(Parent, Child)\
.outerjoin(Child)\
.filter(or_(and_(Parent.age.between(age_min, age_max), Child.weight.between(weight_min, weight_max)), Child.id == None))\
.distinct(Parent.name)\
.group_by(Parent.name)\
.order_by(Parent.name)\
.all()
filter(or_(Parent.age.between(age_min, age_max), Child.weight.between(weight_min, weight_max), Child.id == None))
parents = session.query(Parent).outerjoin(Child)\
  .filter((Parent.age.between(age_min, age_max) & Child.weight.between(weight_min, weight_max)) | (Child.id == None))\
  .order_by(Parent.name)\
  .all()