Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 96 for something (0.21 sec)

  1. docs/em/docs/python-types.md

    {!../../../docs_src/python_types/tutorial009.py!}
    ```
    
    ⚙️ `Optional[str]` ↩️ `str` 🔜 ➡️ 👨‍🎨 ℹ 👆 🔍 ❌ 🌐❔ 👆 💪 🤔 👈 💲 🕧 `str`, 🕐❔ ⚫️ 💪 🤙 `None` 💁‍♂️.
    
    `Optional[Something]` 🤙 ⌨ `Union[Something, None]`, 👫 🌓.
    
    👉 ⛓ 👈 🐍 3️⃣.1️⃣0️⃣, 👆 💪 ⚙️ `Something | None`:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="1  4"
        {!> ../../../docs_src/python_types/tutorial009.py!}
        ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13.6K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/first-steps.md

    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    
    `@app.get("/")` 告诉 **FastAPI** 在它下方的函数负责处理如下访问请求:
    
    * 请求路径为 `/`
    * 使用 <abbr title="HTTP GET 方法"><code>get</code> 操作</abbr>
    
    !!! info "`@decorator` Info"
        `@something` 语法在 Python 中被称为「装饰器」。
    
        像一顶漂亮的装饰帽一样,将它放在一个函数的上方(我猜测这个术语的命名就是这么来的)。
    
        装饰器接收位于其下方的函数并且用它完成一些工作。
    
        在我们的例子中,这个装饰器告诉 **FastAPI** 位于其下方的函数对应着**路径** `/` 加上 `get` **操作**。
    
        它是一个「**路径操作装饰器**」。
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 12 00:06:16 GMT 2022
    - 9.2K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/sql-databases-peewee.md

    The same as with SQLAlchemy, we are not doing something like:
    
    ```Python
    user = await models.User.select().first()
    ```
    
    ...but instead we are using:
    
    ```Python
    user = models.User.select().first()
    ```
    
    So, again, we should declare the *path operation functions* and the dependency without `async def`, just with a normal `def`, as:
    
    ```Python hl_lines="2"
    # Something goes here
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (0)
  4. docs/en/docs/history-design-future.md

    But at some point, there was no other option than creating something that provided all these features, taking the best ideas from previous tools, and combining them in the best way possible, using language features that weren't even available before (Python 3.6+ type hints).
    
    </blockquote>
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  5. docs/zh/docs/tutorial/dependencies/classes-as-dependencies.md

    到目前为止,您看到的依赖项都被声明为函数。
    
    但这并不是声明依赖项的唯一方法(尽管它可能是更常见的方法)。
    
    关键因素是依赖项应该是 "可调用对象"。
    
    Python 中的 "**可调用对象**" 是指任何 Python 可以像函数一样 "调用" 的对象。
    
    所以,如果你有一个对象 `something` (可能*不是*一个函数),你可以 "调用" 它(执行它),就像:
    
    ```Python
    something()
    ```
    
    或者
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    这就是 "可调用对象"。
    
    ## 类作为依赖项
    
    您可能会注意到,要创建一个 Python 类的实例,您可以使用相同的语法。
    
    举个例子:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 6.5K bytes
    - Viewed (0)
  6. docs/en/docs/tutorial/security/oauth2-jwt.md

    Now that we have all the security flow, let's make the application actually secure, using <abbr title="JSON Web Tokens">JWT</abbr> tokens and secure password hashing.
    
    This code is something you can actually use in your application, save the password hashes in your database, etc.
    
    We are going to start from where we left in the previous chapter and increment it.
    
    ## About JWT
    
    JWT means "JSON Web Tokens".
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13K bytes
    - Viewed (0)
  7. docs/zh/docs/tutorial/query-params-str-validations.md

    为此,你可以声明`None`是一个有效的类型,并仍然使用`default=...`:
    
    ```Python hl_lines="9"
    {!../../../docs_src/query_params_str_validations/tutorial006c.py!}
    ```
    
    !!! tip
        Pydantic 是 FastAPI 中所有数据验证和序列化的核心,当你在没有设默认值的情况下使用 `Optional` 或 `Union[Something, None]` 时,它具有特殊行为,你可以在 Pydantic 文档中阅读有关<a href="https://docs.pydantic.dev/latest/concepts/models/#required-optional-fields" class="external-link" target="_blank">必需可选字段</a>的更多信息。
    
    ### 使用Pydantic中的`Required`代替省略号(`...`)
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  8. docs/en/docs/tutorial/response-status-code.md

        * An example is `404`, for a "Not Found" response.
        * For generic errors from the client, you can just use `400`.
    * `500` and above are for server errors. You almost never use them directly. When something goes wrong at some part in your application code, or server, it will automatically return one of these status codes.
    
    !!! tip
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Aug 29 14:02:58 GMT 2020
    - 4K bytes
    - Viewed (0)
  9. docs/em/docs/tutorial/dependencies/classes-as-dependencies.md

    🆙 🔜 👆 ✔️ 👀 🔗 📣 🔢.
    
    ✋️ 👈 🚫 🕴 🌌 📣 🔗 (👐 ⚫️ 🔜 🎲 🌖 ⚠).
    
    🔑 ⚖ 👈 🔗 🔜 "🇧🇲".
    
    "**🇧🇲**" 🐍 🕳 👈 🐍 💪 "🤙" 💖 🔢.
    
    , 🚥 👆 ✔️ 🎚 `something` (👈 💪 _🚫_ 🔢) &amp; 👆 💪 "🤙" ⚫️ (🛠️ ⚫️) 💖:
    
    ```Python
    something()
    ```
    
    ⚖️
    
    ```Python
    something(some_argument, some_keyword_argument="foo")
    ```
    
    ⤴️ ⚫️ "🇧🇲".
    
    ## 🎓 🔗
    
    👆 5️⃣📆 👀 👈 ✍ 👐 🐍 🎓, 👆 ⚙️ 👈 🎏 ❕.
    
    🖼:
    
    ```Python
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat Apr 01 09:26:04 GMT 2023
    - 6K bytes
    - Viewed (0)
  10. docs/en/docs/tutorial/dependencies/index.md

    Although you use `Depends` in the parameters of your function the same way you use `Body`, `Query`, etc, `Depends` works a bit differently.
    
    You only give `Depends` a single parameter.
    
    This parameter must be something like a function.
    
    You **don't call it** directly (don't add the parenthesis at the end), you just pass it as a parameter to `Depends()`.
    
    And that function takes parameters in the same way that *path operation functions* do.
    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)
Back to top