def report_bathroom_by_id(self, id, description): if id is None or not description: return False b = Bathroom.query.filter_by(id=id).first() if b is None: return False rep = Report() rep.bathroom = b rep.description = description db.session.add(rep) db.session.commit() return True