Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Greaves (0.19 sec)

  1. docs/en/docs/tutorial/dependencies/classes-as-dependencies.md

            Prefer to use the `Annotated` version if possible.
    
        ```Python hl_lines="19"
        {!> ../../../docs_src/dependencies/tutorial002.py!}
        ```
    
    **FastAPI** calls the `CommonQueryParams` class. This creates an "instance" of that class and the instance will be passed as the parameter `commons` to your function.
    
    ## Type annotation vs `Depends`
    
    Notice how we write `CommonQueryParams` twice in the above code:
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/dependencies/dependencies-with-yield.md

    ```Python
    with open("./somefile.txt") as f:
        contents = f.read()
        print(contents)
    ```
    
    Underneath, the `open("./somefile.txt")` creates an object that is called a "Context Manager".
    
    When the `with` block finishes, it makes sure to close the file, even if there were exceptions.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 14.1K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/sql-databases-peewee.md

    Import `db` from `database` (the file `database.py` from above) and use it here.
    
    ```Python hl_lines="3  6-12  15-21"
    {!../../../docs_src/sql_databases_peewee/sql_app/models.py!}
    ```
    
    !!! tip
        Peewee creates several magic attributes.
    
        It will automatically add an `id` attribute as an integer to be the primary key.
    
        It will chose the name of the tables based on the class names.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  4. docs/en/docs/async.md

    Then you go to the counter 🔀, to the initial task that is now finished ⏯, pick the burgers, say thanks and take them to the table. That finishes that step / task of interaction with the counter ⏹. That in turn, creates a new task, of "eating burgers" 🔀 ⏯, but the previous one of "getting burgers" is finished ⏹.
    
    ### Parallel Burgers
    
    Now let's imagine these aren't "Concurrent Burgers", but "Parallel Burgers".
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 23K bytes
    - Viewed (0)
  5. docs/en/docs/advanced/additional-status-codes.md

    For example, let's say that you want to have a *path operation* that allows to update items, and returns HTTP status codes of 200 "OK" when successful.
    
    But you also want it to accept new items. And when the items didn't exist before, it creates them, and returns an HTTP status code of 201 "Created".
    
    To achieve that, import `JSONResponse`, and return your content there directly, setting the `status_code` that you want:
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  6. docs/en/docs/help-fastapi.md

    If you select "Watching" instead of "Releases only" you will receive notifications when someone creates a new issue or question. You can also specify that you only want to be notified about new issues, or discussions, or PRs, etc.
    
    Then you can try and help them solve those questions.
    
    ## Ask Questions
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13.7K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/response-model.md

        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="31  37"
        {!> ../../../docs_src/response_model/tutorial005.py!}
        ```
    
    !!! tip
        The syntax `{"name", "description"}` creates a `set` with those two values.
    
        It is equivalent to `set(["name", "description"])`.
    
    #### Using `list`s instead of `set`s
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 17.9K bytes
    - Viewed (0)
Back to top