def get_all(): models = Category.get_all_models(throw=True) for model in models: model._fields = ['id', 'name'] return jsonify(models)