Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 11 - 20 of 322 for rick (0.07 seconds)

  1. docs_src/dependencies/tutorial008e_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    def get_username():
        try:
            yield "Rick"
        finally:
            print("Cleanup up before response is sent")
    
    
    @app.get("/users/me")
    def get_user_me(username: Annotated[str, Depends(get_username, scope="function")]):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 329 bytes
    - Click Count (0)
  2. docs_src/dependencies/tutorial008c_py310.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
            raise InternalError(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 660 bytes
    - Click Count (0)
  3. docs_src/dependencies/tutorial008c_an_py310.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("Oops, we didn't raise again, Britney 😱")
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 700 bytes
    - Click Count (0)
  4. docs_src/dependencies/tutorial012_py310.py

    
    @app.get("/items/")
    async def read_items():
        return [{"item": "Portal Gun"}, {"item": "Plumbus"}]
    
    
    @app.get("/users/")
    async def read_users():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 696 bytes
    - Click Count (0)
  5. docs_src/dependencies/tutorial008e_py310.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    def get_username():
        try:
            yield "Rick"
        finally:
            print("Cleanup up before response is sent")
    
    
    @app.get("/users/me")
    def get_user_me(username: str = Depends(get_username, scope="function")):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 289 bytes
    - Click Count (0)
  6. docs_src/path_operation_configuration/tutorial002b_py310.py

        users = "users"
    
    
    @app.get("/items/", tags=[Tags.items])
    async def get_items():
        return ["Portal gun", "Plumbus"]
    
    
    @app.get("/users/", tags=[Tags.users])
    async def read_users():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 323 bytes
    - Click Count (0)
  7. docs_src/separate_openapi_schemas/tutorial001_py310.py

        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
                description="Device to travel through the multi-rick-verse",
            ),
            Item(name="Plumbus"),
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 451 bytes
    - Click Count (0)
  8. docs_src/separate_openapi_schemas/tutorial002_py310.py

        return item
    
    
    @app.get("/items/")
    def read_items() -> list[Item]:
        return [
            Item(
                name="Portal Gun",
                description="Device to travel through the multi-rick-verse",
            ),
            Item(name="Plumbus"),
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Aug 25 19:10:22 GMT 2023
    - 486 bytes
    - Click Count (0)
  9. tests/test_openapi_separate_input_output_schemas.py

            return item
    
        @app.get("/items/")
        def read_items() -> list[Item]:
            return [
                Item(
                    name="Portal Gun",
                    description="Device to travel through the multi-rick-verse",
                    sub=SubItem(subname="subname"),
                ),
                Item(name="Plumbus"),
            ]
    
        @app.post("/with-computed-field/")
        def create_with_computed_field(
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Tue Feb 17 09:59:14 GMT 2026
    - 27.8K bytes
    - Click Count (0)
  10. docs_src/dependencies/tutorial008d_py310.py

    from fastapi import Depends, FastAPI, HTTPException
    
    app = FastAPI()
    
    
    class InternalError(Exception):
        pass
    
    
    def get_username():
        try:
            yield "Rick"
        except InternalError:
            print("We don't swallow the internal error here, we raise again 😎")
            raise
    
    
    @app.get("/items/{item_id}")
    def get_item(item_id: str, username: str = Depends(get_username)):
        if item_id == "portal-gun":
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 694 bytes
    - Click Count (0)
Back to Top