Skip to content

Instantly share code, notes, and snippets.

@mengzhuo
Created October 23, 2013 16:11
Show Gist options
  • Save mengzhuo/7121617 to your computer and use it in GitHub Desktop.
Save mengzhuo/7121617 to your computer and use it in GitHub Desktop.
Debug
# forms
# ...
AlbumUpdateForm = model_form(Album, db_session=Session,
exclude=[Album.create_at])
#views
# ....
if request.method == "PUT":
form = AlbumUpdateForm(request.form)
if form.validate(): # error is here
form.populate_obj(album)
album.save()
return album.json()
#...
"""
{
"name": [
"Already exists."
]
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment