Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 94 for cell (0.14 sec)

  1. docs_src/sql_databases/sql_app_py39/alt_main.py

    models.Base.metadata.create_all(bind=engine)
    
    app = FastAPI()
    
    
    @app.middleware("http")
    async def db_session_middleware(request: Request, call_next):
        response = Response("Internal server error", status_code=500)
        try:
            request.state.db = SessionLocal()
            response = await call_next(request)
        finally:
            request.state.db.close()
        return response
    
    
    # Dependency
    def get_db(request: Request):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jan 07 14:11:31 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/advanced-dependencies.md

    ## A "callable" instance
    
    In Python there's a way to make an instance of a class a "callable".
    
    Not the class itself (which is already a callable), but an instance of that class.
    
    To do that, we declare a method `__call__`:
    
    === "Python 3.9+"
    
        ```Python hl_lines="12"
        {!> ../../../docs_src/dependencies/tutorial011_an_py39.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="11"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  3. docs/en/docs/advanced/openapi-webhooks.md

    # OpenAPI Webhooks
    
    There are cases where you want to tell your API **users** that your app could call *their* app (sending a request) with some data, normally to **notify** of some type of **event**.
    
    This means that instead of the normal process of your users sending requests to your API, it's **your API** (or your app) that could **send requests to their system** (to their API, their app).
    
    This is normally called a **webhook**.
    
    ## Webhooks steps
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  4. docs/en/docs/advanced/openapi-callbacks.md

    So we are going to use that same knowledge to document how the *external API* should look like... by creating the *path operation(s)* that the external API should implement (the ones your API will call).
    
    !!! tip
        When writing the code to document a callback, it might be useful to imagine that you are that *external developer*. And that you are currently implementing the *external API*, not *your API*.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  5. docs/en/docs/tutorial/extra-models.md

    ```Python
    user_in = UserIn(username="john", password="secret", email="******@****.***")
    ```
    
    and then we call:
    
    ```Python
    user_dict = user_in.dict()
    ```
    
    we now have a `dict` with the data in the variable `user_dict` (it's a `dict` instead of a Pydantic model object).
    
    And if we call:
    
    ```Python
    print(user_dict)
    ```
    
    we would get a Python `dict` with:
    
    ```Python
    {
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.7K bytes
    - Viewed (1)
  6. docs/en/docs/js/custom.js

        }
        return array;
    }
    
    async function showRandomAnnouncement(groupId, timeInterval) {
        const announceFastAPI = document.getElementById(groupId);
        if (announceFastAPI) {
            let children = [].slice.call(announceFastAPI.children);
            children = shuffle(children)
            let index = 0
            const announceRandom = () => {
                children.forEach((el, i) => {el.style.display = "none"});
    JavaScript
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 08 17:50:56 GMT 2021
    - 6.6K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/dependencies/index.md

    Actually, all (or most) of the web frameworks work in this same way.
    
    You never call those functions directly. They are called by your framework (in this case, **FastAPI**).
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. docs/fr/docs/tutorial/background-tasks.md

    Ceci est utile pour les opérations qui doivent avoir lieu après une requête, mais où le client n'a pas réellement besoin d'attendre que l'opération soit terminée pour recevoir une réponse.
    
    Cela comprend, par exemple :
    
    * Les notifications par email envoyées après l'exécution d'une action :
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 5.7K bytes
    - Viewed (0)
  9. docs/en/docs/tutorial/dependencies/sub-dependencies.md

    ```
    
    ## Using the same dependency multiple times
    
    If one of your dependencies is declared multiple times for the same *path operation*, for example, multiple dependencies have a common sub-dependency, **FastAPI** will know to call that sub-dependency only once per request.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 5.6K bytes
    - Viewed (0)
  10. docs/en/docs/features.md

    * <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank"><strong>Swagger UI</strong></a>, with interactive exploration, call and test your API directly from the browser.
    
    ![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 9.3K bytes
    - Viewed (0)
Back to top