This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return lists #56
Comments
Awesome! I'm glad you're liking it. You should be able to:
or:
|
You may (or I may misunderstand what you want to do) be mixing response_model and query parameters
|
God... it's so simple, i feel bad for not thinking of it. Thank you guys! |
Awesome @DaviOtero ! 🎉 As always, thanks @euri10 ! 👏 🌮 🍰 |
Working through the tutorial ( https://fastapi.tiangolo.com/tutorial/ ), hit stumbling block on first try. The command reads: BTW, this editor delates some characters ( such as uderscores, around main ), and even whole words, so I won't be surprised if you can't read this as I typed it. |
@zopefiend Maybe try main = FastAPI() If you did: app = FastAPI() you should run python -m uvicorn main:app --reload In If you installed them in a virtual environment, you should be able to do just |
Thanks for the reply.
…On Mon, Nov 30, 2020 at 4:48 AM ruoshui-git ***@***.***> wrote:
@zopefiend <https://github.com/zopefiend> Maybe try python -m uvicorn
main:main --reload
But make sure in you code, you did:
main = FastAPI()
In main:main, the first main is the package name, or your file name, and
the second main is the var/obj name in the package.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#56 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRHGDETOYBS3DQV6NI7U63SSNZ77ANCNFSM4G2BJXPA>
.
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi there!
First of all, gerat project! Thank You for sharing it!
i'm a somewhat a beginner, i'd like some help if you guys don't mind. (I couldn't find another forum for questions)
I've managed to read a list of objects inside a json, by passing the body like this:
The objective of my micro example is to receive a list of Items (the same base class of the API example), do some processing (change price value by a fixed factor) and return that altered list.
this works:
and i can iterate trough the list with
for item in items:
but when i try to return the list with
return {items}
i get "TypeError: unhashable type: 'list'" error.
is there a simple way to return the list? Or i'll need to create the return string manually?
The text was updated successfully, but these errors were encountered: