Search Options

Results per page
Sort
Preferred Languages
Advance

Results 311 - 320 of 375 for BaseModel (0.14 sec)

  1. docs/uk/docs/tutorial/body.md

    ///
    
    ## Імпортуйте `BaseModel` від Pydantic
    
    Спочатку вам потрібно імпортувати `BaseModel` з `pydantic`:
    
    //// tab | Python 3.8 і вище
    
    ```Python hl_lines="4"
    {!> ../../docs_src/body/tutorial001.py!}
    ```
    
    ////
    
    //// tab | Python 3.10 і вище
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  2. tests/test_security_oauth2_optional.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        },
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  3. fastapi/dependencies/utils.py

            return True
        # If it's a Form (or File) field, it has to be a BaseModel to be top level
        # otherwise it has to be embedded, so that the key value pair can be extracted
        if isinstance(first_field.field_info, params.Form) and not lenient_issubclass(
            first_field.type_, BaseModel
        ):
            return True
        return False
    
    
    async def _extract_form_body(
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 21:46:26 UTC 2024
    - 34.7K bytes
    - Viewed (0)
  4. fastapi/security/http.py

    from fastapi.security.utils import get_authorization_scheme_param
    from pydantic import BaseModel
    from starlette.requests import Request
    from starlette.status import HTTP_401_UNAUTHORIZED, HTTP_403_FORBIDDEN
    from typing_extensions import Annotated, Doc
    
    
    class HTTPBasicCredentials(BaseModel):
        """
        The HTTP Basic credentials given as the result of using `HTTPBasic` in a
        dependency.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Sep 19 09:47:28 UTC 2024
    - 13.2K bytes
    - Viewed (0)
  5. fastapi/openapi/models.py

    class Server(BaseModelWithConfig):
        url: Union[AnyUrl, str]
        description: Optional[str] = None
        variables: Optional[Dict[str, ServerVariable]] = None
    
    
    class Reference(BaseModel):
        ref: str = Field(alias="$ref")
    
    
    class Discriminator(BaseModel):
        propertyName: str
        mapping: Optional[Dict[str, str]] = None
    
    
    class XML(BaseModelWithConfig):
        name: Optional[str] = None
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 22:49:33 UTC 2024
    - 15K bytes
    - Viewed (0)
  6. tests/test_multi_body_errors.py

    from decimal import Decimal
    from typing import List
    
    from dirty_equals import IsDict, IsOneOf
    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, condecimal
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        age: condecimal(gt=Decimal(0.0))  # type: ignore
    
    
    @app.post("/items/")
    def save_item_no_body(item: List[Item]):
        return {"item": item}
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  7. docs/em/docs/tutorial/body.md

    📨 💪 ⏮️ `GET` 📨 ✔️ ⚠ 🎭 🔧, 👐, ⚫️ 🐕‍🦺 FastAPI, 🕴 📶 🏗/😕 ⚙️ 💼.
    
    ⚫️ 🚫, 🎓 🩺 ⏮️ 🦁 🎚 🏆 🚫 🎦 🧾 💪 🕐❔ ⚙️ `GET`, & 🗳 🖕 💪 🚫 🐕‍🦺 ⚫️.
    
    ///
    
    ## 🗄 Pydantic `BaseModel`
    
    🥇, 👆 💪 🗄 `BaseModel` ⚪️➡️ `pydantic`:
    
    //// tab | 🐍 3️⃣.6️⃣ & 🔛
    
    ```Python hl_lines="4"
    {!> ../../docs_src/body/tutorial001.py!}
    ```
    
    ////
    
    //// tab | 🐍 3️⃣.1️⃣0️⃣ & 🔛
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  8. docs/ko/docs/tutorial/body.md

    ///
    
    ## Pydantic의 `BaseModel` 임포트
    
    먼저 `pydantic`에서 `BaseModel`를 임포트해야 합니다:
    
    //// tab | Python 3.10+
    
    ```Python hl_lines="2"
    {!> ../../docs_src/body/tutorial001_py310.py!}
    ```
    
    ////
    
    //// tab | Python 3.8+
    
    ```Python hl_lines="4"
    {!> ../../docs_src/body/tutorial001.py!}
    ```
    
    ////
    
    ## 여러분의 데이터 모델 만들기
    
    `BaseModel`를 상속받은 클래스로 여러분의 데이터 모델을 선언합니다.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  9. tests/test_security_oauth2.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        }
    )
    
    
    class User(BaseModel):
        username: str
    
    
    # Here we use string annotations to test them
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.7K bytes
    - Viewed (0)
  10. tests/test_security_oauth2_optional_description.py

    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    reusable_oauth2 = OAuth2(
        flows={
            "password": {
                "tokenUrl": "token",
                "scopes": {"read:users": "Read the users", "write:users": "Create users"},
            }
        },
        description="OAuth2 security scheme",
        auto_error=False,
    )
    
    
    class User(BaseModel):
        username: str
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 19:40:57 UTC 2024
    - 10.9K bytes
    - Viewed (0)
Back to top