Remove objects from query if None or Null
问题 I am trying to build a query that takes form data and removes any None or " " submissions but I'm not sure how to approach the logic. Here is the code; @app.route('/filterassets', methods=['GET', 'POST']) def searchassets(): form = FilterAssetsForm() results = None if request.method == "POST": if form.validate_on_submit(): try: horsepower = form.horsepower_search.data voltage = form.voltage_search.data rpm = form.rpm_search.data results = Motor.query.filter_by(horsepower=horsepower, voltage