Skip to content

Commit

Permalink
Add missing @post_load decorator in example
Browse files Browse the repository at this point in the history
Closes #706
  • Loading branch information
sloria committed Dec 15, 2017
1 parent 1ff8171 commit 1579398
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/peewee_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from flask import Flask, request, g, jsonify
import peewee as pw
from marshmallow import Schema, fields, validate, pre_load, post_dump
from marshmallow import Schema, fields, validate, pre_load, post_dump, post_load

app = Flask(__name__)
db = pw.SqliteDatabase('/tmp/todo.db')
Expand Down Expand Up @@ -76,6 +76,7 @@ def wrap(self, data, many):
}

# We use make_object to create a new Todo from validated data
@post_load
def make_object(self, data):
if not data:
return None
Expand Down

0 comments on commit 1579398

Please sign in to comment.