Search Options

Results per page
Sort
Preferred Languages
Advance

Results 171 - 180 of 1,638 for item2 (0.03 sec)

  1. docs_src/app_testing/app_b_an_py39/test_main.py

    
    def test_read_nonexistent_item():
        response = client.get("/items/baz", headers={"X-Token": "coneofsilence"})
        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
        response = client.post(
            "/items/",
            headers={"X-Token": "coneofsilence"},
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Aug 15 22:31:16 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  2. tests/test_application.py

                                        "anyOf": [{"type": "string"}, {"type": "null"}],
                                        "title": "Item Id",
                                    }
                                )
                                # TODO: remove when deprecating Pydantic v1
                                | IsDict({"title": "Item Id", "type": "string"}),
                            }
                        ],
                    }
                },
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Apr 18 21:56:59 UTC 2024
    - 52.2K bytes
    - Viewed (0)
  3. docs_src/body/tutorial002_py310.py

    from fastapi import FastAPI
    from pydantic import BaseModel
    
    
    class Item(BaseModel):
        name: str
        description: str | None = None
        price: float
        tax: float | None = None
    
    
    app = FastAPI()
    
    
    @app.post("/items/")
    async def create_item(item: Item):
        item_dict = item.dict()
        if item.tax:
            price_with_tax = item.price + item.tax
            item_dict.update({"price_with_tax": price_with_tax})
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jan 07 14:11:31 UTC 2022
    - 429 bytes
    - Viewed (0)
  4. tests/test_validate_response_recursive/app_pv2.py

    RecursiveItemViaSubmodel.model_rebuild()
    
    
    @app.get("/items/recursive", response_model=RecursiveItem)
    def get_recursive():
        return {"name": "item", "sub_items": [{"name": "subitem", "sub_items": []}]}
    
    
    @app.get("/items/recursive-submodel", response_model=RecursiveItemViaSubmodel)
    def get_recursive_submodel():
        return {
            "name": "item",
            "sub_items1": [
                {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  5. docs_src/dataclasses/tutorial003.py

    
    @dataclass
    class Item:
        name: str
        description: Union[str, None] = None
    
    
    @dataclass
    class Author:
        name: str
        items: List[Item] = field(default_factory=list)  # (3)
    
    
    app = FastAPI()
    
    
    @app.post("/authors/{author_id}/items/", response_model=Author)  # (4)
    async def create_author_items(author_id: str, items: List[Item]):  # (5)
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Jul 31 14:09:15 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/query-params.md

    In this case, if you go to:
    
    ```
    http://127.0.0.1:8000/items/foo?short=1
    ```
    
    or
    
    ```
    http://127.0.0.1:8000/items/foo?short=True
    ```
    
    or
    
    ```
    http://127.0.0.1:8000/items/foo?short=true
    ```
    
    or
    
    ```
    http://127.0.0.1:8000/items/foo?short=on
    ```
    
    or
    
    ```
    http://127.0.0.1:8000/items/foo?short=yes
    ```
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  7. docs_src/response_model/tutorial004.py

    }
    
    
    @app.get("/items/{item_id}", response_model=Item, response_model_exclude_unset=True)
    async def read_item(item_id: str):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat May 14 11:59:59 UTC 2022
    - 633 bytes
    - Viewed (0)
  8. src/main/webapp/WEB-INF/orig/view/searchOptions.jsp

    		<label for="contentLang"><la:message key="labels.index_lang" /></label>
    		<la:select property="lang" styleId="langSearchOption" multiple="true"
    			styleClass="form-control">
    			<c:forEach var="item" items="${langItems}">
    				<la:option value="${f:u(item.value)}">${f:h(item.label)}</la:option>
    			</c:forEach>
    		</la:select>
    	</fieldset>
    	<c:if test="${displayLabelTypeItems}">
    		<fieldset class="form-group">
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Wed Jul 17 08:19:53 UTC 2019
    - 3.7K bytes
    - Viewed (0)
  9. src/main/webapp/WEB-INF/view/searchOptions.jsp

    		<label for="contentLang"><la:message key="labels.index_lang" /></label>
    		<la:select property="lang" styleId="langSearchOption" multiple="true"
    			styleClass="form-control">
    			<c:forEach var="item" items="${langItems}">
    				<la:option value="${f:u(item.value)}">${f:h(item.label)}</la:option>
    			</c:forEach>
    		</la:select>
    	</fieldset>
    	<c:if test="${displayLabelTypeItems}">
    		<fieldset class="form-group">
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Wed Jul 17 08:19:53 UTC 2019
    - 3.7K bytes
    - Viewed (0)
  10. docs/vi/docs/index.md

    ### Kiểm tra
    
    Mở trình duyệt của bạn tại <a href="http://127.0.0.1:8000/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>.
    
    Bạn sẽ thấy một JSON response:
    
    ```JSON
    {"item_id": 5, "q": "somequery"}
    ```
    
    Bạn đã sẵn sàng để tạo một API như sau:
    
    * Nhận HTTP request với _đường dẫn_ `/` và `/items/{item_id}`.
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 20 19:20:23 UTC 2024
    - 21.9K bytes
    - Viewed (0)
Back to top