Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 96 for something (0.2 sec)

  1. tests/test_custom_schema_fields.py

    class Item(BaseModel):
        name: str
    
        if PYDANTIC_V2:
            model_config = {
                "json_schema_extra": {
                    "x-something-internal": {"level": 4},
                }
            }
        else:
    
            class Config:
                schema_extra = {
                    "x-something-internal": {"level": 4},
                }
    
    
    @app.get("/foo", response_model=Item)
    def foo():
        return {"name": "Foo item"}
    
    
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.2K bytes
    - Viewed (0)
  2. docs/en/docs/async.md

    Asynchronous code just means that the language 💬 has a way to tell the computer / program 🤖 that at some point in the code, it 🤖 will have to wait for *something else* to finish somewhere else. Let's say that *something else* is called "slow-file" 📝.
    
    So, during that time, the computer can go and do some other work, while "slow-file" 📝 finishes.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/security/http-basic-auth.md

    At that point, by noticing that the server took some microseconds longer to send the "Incorrect username or password" response, the attackers will know that they got _something_ right, some of the initial letters were right.
    
    And then they can try again knowing that it's probably something more similar to `stanleyjobsox` than to `johndoe`.
    
    #### A "professional" attack
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 14:33:05 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  4. tests/test_repeated_dependency_schema.py

    app = FastAPI()
    
    
    def get_header(*, someheader: str = Header()):
        return someheader
    
    
    def get_something_else(*, someheader: str = Depends(get_header)):
        return f"{someheader}123"
    
    
    @app.get("/")
    def get_deps(dep1: str = Depends(get_header), dep2: str = Depends(get_something_else)):
        return {"dep1": dep1, "dep2": dep2}
    
    
    client = TestClient(app)
    
    schema = {
        "components": {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/encoder.md

    # JSON Compatible Encoder
    
    There are some cases where you might need to convert a data type (like a Pydantic model) to something compatible with JSON (like a `dict`, `list`, etc).
    
    For example, if you need to store it in a database.
    
    For that, **FastAPI** provides a `jsonable_encoder()` function.
    
    ## Using the `jsonable_encoder`
    
    Let's imagine that you have a database `fake_db` that only receives JSON compatible data.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  6. docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md

    しかし、依存関係を定義する方法はそれだけではありません(その方が一般的かもしれませんが)。
    
    重要なのは、依存関係が「呼び出し可能」なものであることです。
    
    Pythonにおける「**呼び出し可能**」とは、Pythonが関数のように「呼び出す」ことができるものを指します。
    
    そのため、`something`オブジェクト(関数ではないかもしれませんが)を持っていて、それを次のように「呼び出す」(実行する)ことができるとします:
    
    ```Python
    something()
    ```
    
    または
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    これを「呼び出し可能」なものと呼びます。
    
    ## 依存関係としてのクラス
    
    Pythonのクラスのインスタンスを作成する際に、同じ構文を使用していることに気づくかもしれません。
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Mon Jan 15 16:08:16 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/first-steps.md

    !!! info "`@decorator` Info"
        That `@something` syntax in Python is called a "decorator".
    
        You put it on top of a function. Like a pretty decorative hat (I guess that's where the term came from).
    
        A "decorator" takes the function below and does something with it.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/middleware.md

    * It takes each **request** that comes to your application.
    * It can then do something to that **request** or run any needed code.
    * Then it passes the **request** to be processed by the rest of the application (by some *path operation*).
    * It then takes the **response** generated by the application (by some *path operation*).
    * It can do something to that **response** or run any needed code.
    * Then it returns the **response**.
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 2.9K bytes
    - Viewed (0)
  9. docs/vi/docs/python-types.md

    `Optional[Something]` là một cách viết ngắn gọn của `Union[Something, None]`, chúng là tương đương nhau.
    
    Điều này cũng có nghĩa là trong Python 3.10, bạn có thể sử dụng `Something | None`:
    
    === "Python 3.10+"
    
        ```Python hl_lines="1"
        {!> ../../../docs_src/python_types/tutorial009_py310.py!}
        ```
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_handling_errors/test_tutorial003.py

    
    def test_get_exception():
        response = client.get("/unicorns/yolo")
        assert response.status_code == 418, response.text
        assert response.json() == {
            "message": "Oops! yolo did something. There goes a rainbow..."
        }
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 3.2K bytes
    - Viewed (0)
Back to top