Skip to content

Commit

Permalink
Merge pull request #45 from simonlify/2.0-stable
Browse files Browse the repository at this point in the history
Fixed update the column is None
  • Loading branch information
JoshYuJump authored Nov 19, 2021
2 parents 285462c + 88f8a55 commit ebf4a6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bali/resources/model_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ def update(self, schema_in: schema = None, pk=None):
item = self.model.first(id=pk)
# noinspection PyUnresolvedReferences
for k, v in schema_in.dict().items():
if v is None:
continue
setattr(item, k, v)
return item.save()

Expand Down

0 comments on commit ebf4a6e

Please sign in to comment.