Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for ORM (0.16 sec)

  1. tests/test_read_with_orm_mode.py

    
    @needs_pydanticv1
    def test_read_with_orm_mode_pv1() -> None:
        class PersonBase(BaseModel):
            name: str
            lastname: str
    
        class Person(PersonBase):
            @property
            def full_name(self) -> str:
                return f"{self.name} {self.lastname}"
    
            class Config:
                orm_mode = True
                read_with_orm_mode = True
    
        class PersonCreate(PersonBase):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 2.4K bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/sql-databases.md

    因此,`orion_cat.owner.name`可能是该宠物主人的姓名(来自表`owners`中的列`name`)。
    
    它可能有一个像`"Arquilian"`(一种业务逻辑)。
    
    当您尝试从您的宠物对象访问它时,ORM 将完成所有工作以从相应的表*所有者那里再获取信息。*
    
    常见的 ORM 例如:Django-ORM(Django 框架的一部分)、SQLAlchemy ORM(SQLAlchemy 的一部分,独立于框架)和 Peewee(独立于框架)等。
    
    在这里,我们将看到如何使用**SQLAlchemy ORM**。
    
    以类似的方式,您也可以使用任何其他 ORM。
    
    !!! tip
        在文档中也有一篇使用 Peewee 的等效的文章。
    
    ## 文件结构
    
    对于这些示例,假设您有一个名为的目录`my_super_project`,其中包含一个名为的子目录`sql_app`,其结构如下:
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 27K bytes
    - Viewed (0)
  3. docs/em/docs/tutorial/sql-databases.md

        👀 👈 `User`, Pydantic *🏷* 👈 🔜 ⚙️ 🕐❔ 👂 👩‍💻 (🛬 ⚫️ ⚪️➡️ 🛠️) 🚫 🔌 `password`.
    
    ### ⚙️ Pydantic `orm_mode`
    
    🔜, Pydantic *🏷* 👂, `Item` & `User`, 🚮 🔗 `Config` 🎓.
    
    👉 <a href="https://docs.pydantic.dev/latest/api/config/" class="external-link" target="_blank">`Config`</a> 🎓 ⚙️ 🚚 📳 Pydantic.
    
    `Config` 🎓, ⚒ 🔢 `orm_mode = True`.
    
    === "🐍 3️⃣.6️⃣ &amp; 🔛"
    
        ```Python hl_lines="15  19-20  31  36-37"
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 25.2K bytes
    - Viewed (1)
  4. docs/ru/docs/tutorial/first-steps.md

    ```
    
    Вы можете вернуть `dict`, `list`, отдельные значения `str`, `int` и т.д.
    
    Также можно вернуть модели Pydantic (рассмотрим это позже).
    
    Многие объекты и модели будут автоматически преобразованы в JSON (включая ORM). Пробуйте использовать другие объекты, которые предпочтительней для Вас, вероятно, они уже поддерживаются.
    
    ## Резюме
    
    * Импортируем `FastAPI`.
    * Создаём экземпляр `app`.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 13.1K bytes
    - Viewed (0)
  5. docs/vi/docs/features.md

    Bao gồm các thư viện bên ngoài cũng dựa trên Pydantic, như <abbr title="Object-Relational Mapper">ORM</abbr>s, <abbr title="Object-Document Mapper">ODM</abbr>s cho cơ sở dữ liệu.
    
    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)
  6. docs/en/docs/tutorial/sql-databases.md

    And the ORM will do all the work to get the information from the corresponding table *owners* when you try to access it from your pet object.
    
    Common ORMs are for example: Django-ORM (part of the Django framework), SQLAlchemy ORM (part of SQLAlchemy, independent of framework) and Peewee (independent of framework), among others.
    
    Here we will see how to work with **SQLAlchemy ORM**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
  7. docs/en/docs/how-to/async-sql-encode-databases.md

    Later, for your production application, you might want to use a database server like **PostgreSQL**.
    
    !!! tip
        You could adopt ideas from the section about SQLAlchemy ORM ([SQL (Relational) Databases](../tutorial/sql-databases.md){.internal-link target=_blank}), like using utility functions to perform operations in the database, independent of your **FastAPI** code.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  8. docs/en/docs/how-to/sql-databases-peewee.md

    If you are starting a project from scratch, you are probably better off with SQLAlchemy ORM ([SQL (Relational) Databases](../tutorial/sql-databases.md){.internal-link target=_blank}), or any other async ORM.
    
    If you already have a code base that uses <a href="https://docs.peewee-orm.com/en/latest/" class="external-link" target="_blank">Peewee ORM</a>, you can check here how to use it with **FastAPI**.
    
    !!! warning "Python 3.7+ required"
    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 (1)
  9. docs/en/docs/project-generation.md

    ## Full Stack FastAPI Template - Technology Stack and Features
    
    - ⚡ [**FastAPI**](https://fastapi.tiangolo.com) for the Python backend API.
        - 🧰 [SQLModel](https://sqlmodel.tiangolo.com) for the Python SQL database interactions (ORM).
        - 🔍 [Pydantic](https://docs.pydantic.dev), used by FastAPI, for the data validation and settings management.
        - 💾 [PostgreSQL](https://www.postgresql.org) as the SQL database.
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 21 21:12:21 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  10. docs/ja/docs/tutorial/first-steps.md

    ```Python hl_lines="8"
    {!../../../docs_src/first_steps/tutorial001.py!}
    ```
    
    `dict`、`list`、`str`、`int`などを返すことができます。
    
    Pydanticモデルを返すこともできます(後で詳しく説明します)。
    
    JSONに自動的に変換されるオブジェクトやモデルは他にもたくさんあります(ORMなど)。 お気に入りのものを使ってみてください。すでにサポートされている可能性が高いです。
    
    ## まとめ
    
    * `FastAPI`をインポート
    * `app`インスタンスを生成
    * **パスオペレーションデコレータ**を記述 (`@app.get("/")`)
    * **パスオペレーション関数**を定義 (上記の`def root(): ...`のように)
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 11.2K bytes
    - Viewed (0)
Back to top