Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dependencies] Fix, support marshmallow 3 #1334

Merged
merged 17 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[dependencies] Fix, support marshmallow 3
  • Loading branch information
dpgaspar committed Mar 27, 2020
commit e299f12e6f6374d36186e16df21180be11c44226
10 changes: 5 additions & 5 deletions flask_appbuilder/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,7 @@ def get_headless(self, pk, **kwargs) -> Response:
_show_model_schema = self.show_model_schema

_response["id"] = pk
_response[API_RESULT_RES_KEY] = _show_model_schema.dump(item, many=False).data
_response[API_RESULT_RES_KEY] = _show_model_schema.dump(item, many=False)
self.pre_get(_response)
return self.response(200, **_response)

Expand Down Expand Up @@ -1402,7 +1402,7 @@ def get_list_headless(self, **kwargs) -> Response:
select_columns=query_select_columns,
)
pks = self.datamodel.get_keys(lst)
_response[API_RESULT_RES_KEY] = _list_model_schema.dump(lst, many=True).data
_response[API_RESULT_RES_KEY] = _list_model_schema.dump(lst, many=True)
_response["ids"] = pks
_response["count"] = count
self.pre_get_list(_response)
Expand Down Expand Up @@ -1490,7 +1490,7 @@ def post_headless(self) -> Response:
**{
API_RESULT_RES_KEY: self.add_model_schema.dump(
item.data, many=False
).data,
),
"id": self.datamodel.get_pk_value(item.data),
},
)
Expand Down Expand Up @@ -1561,7 +1561,7 @@ def put_headless(self, pk) -> Response:
**{
API_RESULT_RES_KEY: self.edit_model_schema.dump(
item.data, many=False
).data
)
},
)
except IntegrityError as e:
Expand Down Expand Up @@ -1823,7 +1823,7 @@ def _merge_update_item(self, model_item, data):
:param data: python data structure
:return: python data structure
"""
data_item = self.edit_model_schema.dump(model_item, many=False).data
data_item = self.edit_model_schema.dump(model_item, many=False)
for _col in self.edit_columns:
if _col not in data.keys():
data[_col] = data_item[_col]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jsonschema==3.0.1
markupsafe==1.1.1 # via jinja2
marshmallow-enum==1.4.1
marshmallow-sqlalchemy==0.16.2
marshmallow==2.18.0
marshmallow==3.5.1
prison==0.1.2
pyjwt==1.7.1
pyrsistent==0.14.11 # via jsonschema
Expand Down