Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for Trick (0.15 sec)

  1. docs/en/docs/advanced/dataclasses.md

    !!! info
        Keep in mind that dataclasses can't do everything Pydantic models can do.
    
        So, you might still need to use Pydantic models.
    
        But if you have a bunch of dataclasses laying around, this is a nice trick to use them to power a web API using FastAPI. 🤓
    
    ## Dataclasses in `response_model`
    
    You can also use `dataclasses` in the `response_model` parameter:
    
    ```Python hl_lines="1  7-13  19"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  2. docs/de/docs/advanced/dataclasses.md

        Daher müssen Sie möglicherweise weiterhin Pydantic-Modelle verwenden.
    
        Wenn Sie jedoch eine Menge Datenklassen herumliegen haben, ist dies ein guter Trick, um sie für eine Web-API mithilfe von FastAPI zu verwenden. 🤓
    
    ## Datenklassen als `response_model`
    
    Sie können `dataclasses` auch im Parameter `response_model` verwenden:
    
    ```Python hl_lines="1  7-13  19"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:18:23 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/path-operation-advanced-configuration.md

    Nevertheless, we can declare the expected schema for the request body.
    
    ### Custom OpenAPI content type
    
    Using this same trick, you could use a Pydantic model to define the JSON Schema that is then included in the custom OpenAPI schema section for the *path operation*.
    
    And you could do this even if the data type in the request is not JSON.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/path-operation-advanced-configuration.md

    Dennoch können wir das zu erwartende Schema für den Requestbody deklarieren.
    
    ### Benutzerdefinierter OpenAPI-Content-Type
    
    Mit demselben Trick könnten Sie ein Pydantic-Modell verwenden, um das JSON-Schema zu definieren, das dann im benutzerdefinierten Abschnitt des OpenAPI-Schemas für die *Pfadoperation* enthalten ist.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 20:27:23 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  5. docs/de/docs/tutorial/path-params-numeric-validations.md

        ```
    
    ## Sortieren Sie die Parameter wie Sie möchten: Tricks
    
    !!! tip "Tipp"
        Wenn Sie `Annotated` verwenden, ist das folgende nicht so wichtig / nicht notwendig.
    
    Hier ein **kleiner Trick**, der nützlich sein kann, aber Sie werden ihn nicht oft brauchen.
    
    Wenn Sie eines der folgenden Dinge tun möchten:
    
    * den `q`-Parameter ohne `Query` oder irgendeinem Defaultwert deklarieren
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 17:59:29 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/dependencies/index.md

    !!! tip
        This is just standard Python, it's called a "type alias", it's actually not specific to **FastAPI**.
    
        But because **FastAPI** is based on the Python standards, including `Annotated`, you can use this trick in your code. 😎
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  7. docs/de/docs/tutorial/dependencies/index.md

        Das ist schlicht Standard-Python, es wird als „Typalias“ bezeichnet und ist eigentlich nicht **FastAPI**-spezifisch.
    
        Da **FastAPI** jedoch auf Standard-Python, einschließlich `Annotated`, basiert, können Sie diesen Trick in Ihrem Code verwenden. 😎
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:01:10 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  8. docs/de/docs/deployment/docker.md

    ```Dockerfile
    CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
    ```
    
    #### Docker-Cache
    
    In diesem `Dockerfile` gibt es einen wichtigen Trick: Wir kopieren zuerst die **Datei nur mit den Abhängigkeiten**, nicht den Rest des Codes. Lassen Sie mich Ihnen erklären, warum.
    
    ```Dockerfile
    COPY ./requirements.txt /code/requirements.txt
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Mar 30 18:19:17 GMT 2024
    - 38.9K bytes
    - Viewed (0)
  9. docs/en/docs/deployment/docker.md

    ```Dockerfile
    CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
    ```
    
    #### Docker Cache
    
    There's an important trick in this `Dockerfile`, we first copy the **file with the dependencies alone**, not the rest of the code. Let me tell you why is that.
    
    ```Dockerfile
    COPY ./requirements.txt /code/requirements.txt
    ```
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 34.3K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/base/Preconditions.java

       *
       * But the methods in this class want to throw different exceptions, depending on the args, so it
       * appears that this pattern is not directly applicable. But we can use the ridiculous, devious
       * trick of throwing an exception in the middle of the construction of another exception. Hotspot
       * is fine with that.
       */
    
      /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 11 11:52:14 GMT 2024
    - 52.9K bytes
    - Viewed (0)
Back to top