Search Options

Results per page
Sort
Preferred Languages
Advance

Results 211 - 220 of 1,072 for Str (0.08 sec)

  1. docs_src/additional_responses/tutorial004.py

    from typing import Union
    
    from fastapi import FastAPI
    from fastapi.responses import FileResponse
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        id: str
        value: str
    
    
    responses = {
        404: {"description": "Item not found"},
        302: {"description": "The item was moved"},
        403: {"description": "Not enough privileges"},
    }
    
    
    app = FastAPI()
    
    
    @app.get(
        "/items/{item_id}",
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 701 bytes
    - Viewed (0)
  2. docs_src/body_multiple_params/tutorial001_an_py39.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        item_id: Annotated[int, Path(title="The ID of the item to get", ge=0, le=1000)],
        q: Union[str, None] = None,
        item: Union[Item, None] = None,
    ):
        results = {"item_id": item_id}
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Mar 18 12:29:59 UTC 2023
    - 610 bytes
    - Viewed (0)
  3. docs/bn/docs/python-types.md

    ```Python hl_lines="1  4"
    {!../../docs_src/python_types/tutorial009.py!}
    ```
    
    `Optional[str]` ব্যবহার করা মানে হল শুধু `str` নয়, এটি হতে পারে `None`-ও, যা আপনার এডিটরকে সেই ত্রুটিগুলি শনাক্ত করতে সাহায্য করবে যেখানে আপনি ধরে নিচ্ছেন যে একটি মান সবসময় `str` হবে, অথচ এটি `None`-ও হতে পারেও।
    
    `Optional[Something]` মূলত `Union[Something, None]`-এর একটি শর্টকাট, এবং তারা সমতুল্য।
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 35.8K bytes
    - Viewed (0)
  4. tests/test_ws_dependencies.py

    from fastapi.testclient import TestClient
    from typing_extensions import Annotated
    
    
    def dependency_list() -> List[str]:
        return []
    
    
    DepList = Annotated[List[str], Depends(dependency_list)]
    
    
    def create_dependency(name: str):
        def fun(deps: DepList):
            deps.append(name)
    
        return Depends(fun)
    
    
    router = APIRouter(dependencies=[create_dependency("router")])
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Jun 11 20:35:39 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  5. docs_src/path_operation_configuration/tutorial004.py

    from typing import Set, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
    
    
    @app.post("/items/", response_model=Item, summary="Create an item")
    async def create_item(item: Item):
        """
        Create an item with all the information:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 681 bytes
    - Viewed (0)
  6. docs_src/path_operation_configuration/tutorial005_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        response_description="The created item",
    )
    async def create_item(item: Item):
        """
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 698 bytes
    - Viewed (0)
  7. internal/config/compress/compress_test.go

    		{"text/*,application/json", []string{"text/*", "application/json"}, true},
    	}
    
    	for _, testCase := range testCases {
    		testCase := testCase
    		t.Run(testCase.str, func(t *testing.T) {
    			gotPatterns, err := parseCompressIncludes(testCase.str)
    			if !testCase.success && err == nil {
    				t.Error("expected failure but success instead")
    			}
    			if testCase.success && err != nil {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Jun 01 21:59:40 UTC 2021
    - 1.8K bytes
    - Viewed (0)
  8. docs_src/settings/app02/config.py

    from pydantic_settings import BaseSettings
    
    
    class Settings(BaseSettings):
        app_name: str = "Awesome API"
        admin_email: str
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 159 bytes
    - Viewed (0)
  9. docs_src/path_operation_advanced_configuration/tutorial004.py

    from typing import Set, Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: Set[str] = set()
    
    
    @app.post("/items/", response_model=Item, summary="Create an item")
    async def create_item(item: Item):
        """
        Create an item with all the information:
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 717 bytes
    - Viewed (0)
  10. docs_src/path_operation_configuration/tutorial005_py39.py

    from typing import Union
    
    from fastapi import FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
        tags: set[str] = set()
    
    
    @app.post(
        "/items/",
        response_model=Item,
        summary="Create an item",
        response_description="The created item",
    )
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 736 bytes
    - Viewed (0)
Back to top