mirror of
https://github.com/wowlikon/LiB.git
synced 2026-02-04 12:31:09 +00:00
Динамическое создание er-диаграммы по моделям
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Модуль DB-моделей авторов"""
|
||||
|
||||
from typing import TYPE_CHECKING, List
|
||||
|
||||
from sqlmodel import Field, Relationship
|
||||
@@ -12,7 +13,10 @@ if TYPE_CHECKING:
|
||||
|
||||
class Author(AuthorBase, table=True):
|
||||
"""Модель автора в базе данных"""
|
||||
id: int | None = Field(default=None, primary_key=True, index=True)
|
||||
|
||||
id: int | None = Field(
|
||||
default=None, primary_key=True, index=True, description="Идентификатор"
|
||||
)
|
||||
books: List["Book"] = Relationship(
|
||||
back_populates="authors", link_model=AuthorBookLink
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user