Search Options

Results per page
Sort
Preferred Languages
Advance

Results 181 - 190 of 585 for Depends (0.08 sec)

  1. tests/test_filter_pydantic_sub_model_pv2.py

    from typing import Optional
    
    import pytest
    from dirty_equals import HasRepr, IsDict, IsOneOf
    from fastapi import Depends, FastAPI
    from fastapi.exceptions import ResponseValidationError
    from fastapi.testclient import TestClient
    
    from .utils import needs_pydanticv2
    
    
    @pytest.fixture(name="client")
    def get_client():
        from pydantic import BaseModel, ValidationInfo, field_validator
    
        app = FastAPI()
    
        class ModelB(BaseModel):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 6.3K bytes
    - Viewed (0)
  2. fastapi/routing.py

            self.dependant = get_dependant(path=self.path_format, call=self.endpoint)
            for depends in self.dependencies[::-1]:
                self.dependant.dependencies.insert(
                    0,
                    get_parameterless_sub_dependant(depends=depends, path=self.path_format),
                )
            self._flat_dependant = get_flat_dependant(self.dependant)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Oct 12 09:44:57 UTC 2024
    - 172.1K bytes
    - Viewed (0)
  3. docs_src/websockets/tutorial002_an_py310.py

    from typing import Annotated
    
    from fastapi import (
        Cookie,
        Depends,
        FastAPI,
        Query,
        WebSocket,
        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
            <form action="" onsubmit="sendMessage(event)">
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  4. docs_src/websockets/tutorial002_py310.py

    from fastapi import (
        Cookie,
        Depends,
        FastAPI,
        Query,
        WebSocket,
        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
            <form action="" onsubmit="sendMessage(event)">
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.7K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/security/get-current-user.md

    ๐Ÿ‘† 5๏ธโƒฃ๐Ÿ“† ๐Ÿ’ญ ๐Ÿ‘ˆ ๐Ÿ“จ ๐Ÿ’ช ๐Ÿ“ฃ โฎ๏ธ Pydantic ๐Ÿท.
    
    ๐Ÿ“ฅ **FastAPI** ๐Ÿ† ๐Ÿšซ ๐Ÿคš ๐Ÿ˜จ โ†ฉ๏ธ ๐Ÿ‘† โš™๏ธ `Depends`.
    
    ///
    
    /// check
    
    ๐ŸŒŒ ๐Ÿ‘‰ ๐Ÿ”— โš™๏ธ ๐Ÿ— โœ” ๐Ÿ‘ฅ โœ”๏ธ ๐ŸŽ ๐Ÿ”— (๐ŸŽ "โ˜‘") ๐Ÿ‘ˆ ๐ŸŒ ๐Ÿ“จ `User` ๐Ÿท.
    
    ๐Ÿ‘ฅ ๐Ÿšซ ๐Ÿšซ โœ”๏ธ ๐Ÿ•ด 1๏ธโƒฃ ๐Ÿ”— ๐Ÿ‘ˆ ๐Ÿ’ช ๐Ÿ“จ ๐Ÿ‘ˆ ๐Ÿ†Ž ๐Ÿ’ฝ.
    
    ///
    
    ## ๐ŸŽ ๐Ÿท
    
    ๐Ÿ‘† ๐Ÿ’ช ๐Ÿ”œ ๐Ÿคš โฎ๏ธ ๐Ÿ‘ฉโ€๐Ÿ’ป ๐Ÿ”— *โžก ๐Ÿ› ๏ธ ๐Ÿ”ข* &amp; ๐Ÿ™… โฎ๏ธ ๐Ÿ’‚โ€โ™‚ ๐Ÿ› ๏ธ **๐Ÿ”— ๐Ÿ’‰** ๐ŸŽš, โš™๏ธ `Depends`.
    
    &amp; ๐Ÿ‘† ๐Ÿ’ช โš™๏ธ ๐Ÿ™† ๐Ÿท โš–๏ธ ๐Ÿ’ฝ ๐Ÿ’‚โ€โ™‚ ๐Ÿ“„ (๐Ÿ‘‰ ๐Ÿ’ผ, Pydantic ๐Ÿท `User`).
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  6. tests/test_security_oauth2_optional.py

            return None
        user = User(username=oauth_header)
        return user
    
    
    @app.post("/login")
    def login(form_data: OAuth2PasswordRequestFormStrict = Depends()):
        return form_data
    
    
    @app.get("/users/me")
    def read_users_me(current_user: Optional[User] = Depends(get_current_user)):
        if current_user is None:
            return {"msg": "Create an account first"}
        return current_user
    
    
    client = TestClient(app)
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  7. docs_src/sql_databases/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Depends, FastAPI, HTTPException, Query
    from sqlmodel import Field, Session, SQLModel, create_engine, select
    
    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: Union[int, None] = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: Union[int, None] = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  8. docs_src/websockets/tutorial002_an.py

    from typing import Union
    
    from fastapi import (
        Cookie,
        Depends,
        FastAPI,
        Query,
        WebSocket,
        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    from typing_extensions import Annotated
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  9. docs_src/websockets/tutorial002_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import (
        Cookie,
        Depends,
        FastAPI,
        Query,
        WebSocket,
        WebSocketException,
        status,
    )
    from fastapi.responses import HTMLResponse
    
    app = FastAPI()
    
    html = """
    <!DOCTYPE html>
    <html>
        <head>
            <title>Chat</title>
        </head>
        <body>
            <h1>WebSocket Chat</h1>
            <form action="" onsubmit="sendMessage(event)">
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  10. docs/pt/docs/advanced/security/oauth2-scopes.md

    /// info | Informaรงรตes Tรฉcnicas
    
    `Security` รฉ na verdade uma subclasse de `Depends`, e ele possui apenas um parรขmetro extra que veremos depois.
    
    Porรฉm ao utilizar `Security` no lugar de `Depends`, o **FastAPI** saberรก que ele pode declarar escopos de seguranรงa, utilizรก-los internamente, e documentar a API com o OpenAPI.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 21.7K bytes
    - Viewed (0)
Back to top