flask-reuploaded icon indicating copy to clipboard operation
flask-reuploaded copied to clipboard

Update documentations

Open tabebqena opened this issue 2 years ago • 2 comments

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.

tabebqena avatar Jul 21 '22 21:07 tabebqena

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.

jugmac00 avatar Jul 22 '22 20:07 jugmac00

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.

tabebqena avatar Jul 22 '22 22:07 tabebqena

Fixed by #135 - once more - thanks so much!

P.S.: I squashed all commits into one.

jugmac00 avatar Nov 05 '22 18:11 jugmac00