flask-reuploaded
flask-reuploaded copied to clipboard
Update documentations
Thanks for great work.
Just, I suggest to update the documentation which is still copied from flask-uploads
documentations.
As an example, This code is present in the documentation in the readthdoc:
@app.route('/upload', methods=['GET', 'POST'])
def upload():
if request.method == 'POST' and 'photo' in request.files:
filename = photos.save(request.files['photo'])
rec = Photo(filename=filename, user=g.user.id)
# ^^^^^^^^^ What is `Photo`? When it was defined?
rec.store()
flash("Photo saved.")
# Why the following redirect?
# You have implemented special logic for autoserving
# This redirect will be broken without properly configuring the app.
return redirect(url_for('show', id=rec.id))
return render_template('upload.html')
In addition to the lack of documentation of the autoserving functionality, I need to read the tests to understand.
Thanks a lot for taking the time to raise this issue.
a) example in the documentation
Great catch! Indeed - the documentation was copied along with the source code when I created this fork.
I put some effort into the README to have both a good overview of the intentions of this package, and to have a concise example. I thought back and forth for some time whether I wanted to keep the documentation, but it contained some parts which I thought would be still relevant, but obviously I did not take the same care to double check the examples.
b) autoserve
The last paragraph of the configruation documentation introduces and explains this feature. While the info is a bit dense, I think it explains all.
Ideally, we could have a "how to serve picture uploads automatically" document or something like that.
This all said - I am currently building a house for my family, so unfortunately I cannot spend the time to improve the documentation.
A PR with some improvements would be very helpful, and I certainly would find the time to review it. If nobody finds the time, I think I would have some spare time again from October on.
Thanks again for the report and your kind words.
Thanks alot, I will try to write PR for this. Obviuosly my english skill is not very good. But I will make a try.
I wish you to build a beutiful house.
Fixed by #135 - once more - thanks so much!
P.S.: I squashed all commits into one.