def delete_all(): Sample.objects.all().delete() Collect.objects().all().delete() LoanHistory.objects().all().delete() Equipment.objects().all().delete() Sensor.objects().all().delete() Patient.objects().all().delete() return jsonify({'message': 'deleted with success.'})
def delete_all(): db.session.delete(Sample.query.all()) Collect.objects().all().delete() LoanHistory.objects().all().delete() Equipment.objects().all().delete() Sensor.objects().all().delete() Patient.objects().all().delete() db.session.commit() return jsonify({'message': 'deleted with success.'})