Search Options

Results per page
Sort
Preferred Languages
Advance

Results 551 - 560 of 1,058 for Fstr (0.52 sec)

  1. docs_src/body_fields/tutorial001_an_py39.py

    from typing import Annotated, Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = Field(
            default=None, title="The description of the item", max_length=300
        )
        price: float = Field(gt=0, description="The price must be greater than zero")
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 582 bytes
    - Viewed (0)
  2. tests/test_openapi_examples.py

    from typing import Union
    
    from fastapi import Body, Cookie, FastAPI, Header, Path, Query
    from fastapi.testclient import TestClient
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        data: str
    
    
    @app.post("/examples/")
    def examples(
        item: Item = Body(
            examples=[
                {"data": "Data in Body examples, example1"},
            ],
            openapi_examples={
                "Example One": {
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.1K bytes
    - Viewed (0)
  3. src/test/java/jcifs/smb1/smb1/Trans2QueryFSInformationTest.java

            String str = cmd.toString();
            // toString uses Hexdump.toHexString(informationLevel, 3)
            assertTrue(str.contains(Hexdump.toHexString(level, 3)), "toString should contain hex level");
            assertTrue(str.contains("Trans2QueryFSInformation["), "should start with class name");
            assertTrue(str.contains(",informationLevel=0x"), "should contain level field marker");
        }
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  4. docs_src/dependencies/tutorial008d_py39.py

        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":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 694 bytes
    - Viewed (0)
  5. docs_src/dependencies/tutorial008d_an_py39.py

        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: Annotated[str, Depends(get_username)]):
        if item_id == "portal-gun":
            raise InternalError(
                f"The portal gun is too dangerous to be owned by {username}"
            )
        if item_id != "plumbus":
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Feb 24 23:06:37 UTC 2024
    - 734 bytes
    - Viewed (0)
  6. docs_src/dependencies/tutorial012_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI, Header, HTTPException
    
    
    async def verify_token(x_token: Annotated[str, Header()]):
        if x_token != "fake-super-secret-token":
            raise HTTPException(status_code=400, detail="X-Token header invalid")
    
    
    async def verify_key(x_key: Annotated[str, Header()]):
        if x_key != "fake-super-secret-key":
            raise HTTPException(status_code=400, detail="X-Key header invalid")
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 746 bytes
    - Viewed (0)
  7. fess-crawler/src/test/java/org/codelibs/fess/crawler/util/TextUtilTest.java

        }
    
        public static String normalizeText(final String str, final int initialCapacity, final int maxAlphanumTermSize,
                final int maxSymbolTermSize, final boolean removeDuplication) {
            if (str == null) {
                return StringUtil.EMPTY;
            }
            try (final Reader reader = new StringReader(str)) {
    Registered: Sat Dec 20 11:21:39 UTC 2025
    - Last Modified: Thu Aug 07 02:55:08 UTC 2025
    - 8.2K bytes
    - Viewed (0)
  8. docs/zh/docs/python-types.md

    ### 添加类型
    
    让我们来修改上面例子的一行代码。
    
    我们将把下面这段代码中的函数参数从:
    
    ```Python
        first_name, last_name
    ```
    
    改成:
    
    ```Python
        first_name: str, last_name: str
    ```
    
    就是这样。
    
    这些就是"类型提示":
    
    {* ../../docs_src/python_types/tutorial002.py hl[1] *}
    
    
    这和声明默认值是不同的,例如:
    
    ```Python
        first_name="john", last_name="doe"
    ```
    
    这两者不一样。
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Aug 18 06:34:40 UTC 2025
    - 8.6K bytes
    - Viewed (0)
  9. tests/test_response_model_default_factory.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from pydantic import BaseModel, Field
    
    app = FastAPI()
    
    
    class ResponseModel(BaseModel):
        code: int = 200
        message: str = Field(default_factory=lambda: "Successful operation.")
    
    
    @app.get(
        "/response_model_has_default_factory_return_dict",
        response_model=ResponseModel,
    )
    async def response_model_has_default_factory_return_dict():
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Sep 20 18:51:40 UTC 2025
    - 1.2K bytes
    - Viewed (0)
  10. docs/uk/docs/tutorial/body-nested-models.md

    * Передайте внутрішні типи як "параметри типу", використовуючи квадратні дужки: `[` and `]`.
    
    У Python 3.9 це буде виглядати так:
    
    ```Python
    my_list: list[str]
    ```
    
    У версіях Python до 3.9 це виглядає так:
    
    ```Python
    from typing import List
    
    my_list: List[str]
    ```
    
    Це стандартний синтаксис Python для оголошення типів.
    
    Використовуйте той самий стандартний синтаксис для атрибутів моделей з внутрішніми типами.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Feb 28 14:18:01 UTC 2025
    - 10.8K bytes
    - Viewed (0)
Back to top