Revised the documentation of the columns of the data models.

This commit is contained in:
依瑪貓 2023-06-05 16:54:38 +08:00
parent 9a4e04c41f
commit 7cb01b4cee

View File

@ -40,7 +40,7 @@ class BaseAccount(db.Model):
__tablename__ = "accounting_base_accounts" __tablename__ = "accounting_base_accounts"
"""The table name.""" """The table name."""
code: Mapped[str] = mapped_column(primary_key=True) code: Mapped[str] = mapped_column(primary_key=True)
"""The code.""" """The account code."""
title_l10n: Mapped[str] = mapped_column("title") title_l10n: Mapped[str] = mapped_column("title")
"""The title.""" """The title."""
l10n: Mapped[list[BaseAccountL10n]] \ l10n: Mapped[list[BaseAccountL10n]] \
@ -87,7 +87,7 @@ class BaseAccountL10n(db.Model):
= mapped_column(db.ForeignKey(BaseAccount.code, onupdate="CASCADE", = mapped_column(db.ForeignKey(BaseAccount.code, onupdate="CASCADE",
ondelete="CASCADE"), ondelete="CASCADE"),
primary_key=True) primary_key=True)
"""The code of the account.""" """The account code."""
account: Mapped[BaseAccount] = db.relationship(back_populates="l10n") account: Mapped[BaseAccount] = db.relationship(back_populates="l10n")
"""The account.""" """The account."""
locale: Mapped[str] = mapped_column(primary_key=True) locale: Mapped[str] = mapped_column(primary_key=True)
@ -369,9 +369,9 @@ class Currency(db.Model):
__tablename__ = "accounting_currencies" __tablename__ = "accounting_currencies"
"""The table name.""" """The table name."""
code: Mapped[str] = mapped_column(primary_key=True) code: Mapped[str] = mapped_column(primary_key=True)
"""The code.""" """The currency code."""
name_l10n: Mapped[str] = mapped_column("name") name_l10n: Mapped[str] = mapped_column("name")
"""The name.""" """The currency name."""
created_at: Mapped[dt.datetime] \ created_at: Mapped[dt.datetime] \
= mapped_column(db.DateTime(timezone=True), = mapped_column(db.DateTime(timezone=True),
server_default=db.func.now()) server_default=db.func.now())
@ -544,7 +544,7 @@ class JournalEntry(db.Model):
date: Mapped[dt.date] date: Mapped[dt.date]
"""The date.""" """The date."""
no: Mapped[int] = mapped_column(default=text("1")) no: Mapped[int] = mapped_column(default=text("1"))
"""The account number under the date.""" """The journal entry number under the date."""
note: Mapped[str | None] note: Mapped[str | None]
"""The note.""" """The note."""
created_at: Mapped[dt.datetime] \ created_at: Mapped[dt.datetime] \