0

Very good day!

So, what i need to do, if i have an error TypeError: 'method' object is not subscriptable in Flas

file = flask.request.files.getlist['propert_photo[]']
TypeError: 'method' object is not subscriptable
<div class="form-group">
    <label for="exampleFormControlFile1">Фотографии</label>
    <input name = "propert_photo[]" type="file" accept="image/png" multiple="" class="form-control-file" id="exampleFormControlFile1">
</div>

pls help

1 Answer 1

2

file = flask.request.files.getlist['propert_photo[]']
should be
file = flask.request.files.getlist('propert_photo[]')

getlist is a method, and a method call uses () and not [].

"Subscriptable" in Python refers to whether or not you can use the square bracket syntax (like a[0]) on an object (or, in other words: whether or not it implements the __getitem__() method). Indeed, a method/function object does not enable this syntax.

Sign up to request clarification or add additional context in comments.

3 Comments

You're very welcome :)
okay, just a moment, thats an error (You can accept an answer in 8 minutes) so i waiting
good luck and thank you too!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.