1. Matthew Frazier
  2. flask-uploads
  3. Issues
Issue #9 new

correction to the DOC

Anonymous created an issue

In the main doc page that is exported to the flask extensions page. There is an example:

@app.route('/upload', methods=['GET', 'POST']) {{{

!python

if request.method == 'POST' and 'photo' in request.files:
    filename = photos.save(request.files['photo'])
    rec = Photo(filename=filename, user=g.user.id)
    rec.store()
    flash("Photo saved.")
    return redirect(url_for('show', id=rec.id))
return render_template('upload.html')

}}}def upload():

The two lines of code with "rec" are referring to store some information in a DB of some kind. It is very misleading. It would be nicer with a comment or even remove it.

Comments (1)

  1. Log in to comment