Trying to write a website that will allow users to upload photos, and so far, I've been using the Flask-Uploads library (docs here)
Used in the example in the docs is a class Photo
that seems fairly critical:
rec = Photo(filename=filename, user=g.user.id)
rec.store()
...
photo = Photo.load(id)
Problem being that the name Photo
doesn't exist in flask.ext.uploads
and I'm not sure where to upload it from.
Has anyone else experienced the same issue?
Photo
is a model class that you'd need to define. If you take a look at the example application you'll see a class namedPost
.This particular example was made using Flask-CouchDB, but you can use any data store you'd like. You'll just need to replace the lines that save the
Photo
orPost
with however you save references to uploaded files in your application.