Compare commits

..

No commits in common. "975b00bce9789e9202262aa2c0cd7c4fc8e1cb86" and "dde9c38bb8ebf15080431ffc504326f6354461a3" have entirely different histories.

2 changed files with 9 additions and 17 deletions

View File

@ -17,7 +17,7 @@
[metadata]
name = mia-accounting-flask
version = 0.1.1
version = 0.1.0
author = imacat
author_email = imacat@mail.imacat.idv.tw
description = The Mia! Accounting Flask project.

View File

@ -69,10 +69,8 @@ class BaseAccountL10n(db.Model):
"""A localized base account title."""
__tablename__ = "accounting_base_accounts_l10n"
"""The table name."""
account_code = db.Column(db.String,
db.ForeignKey(BaseAccount.code,
onupdate="CASCADE",
ondelete="CASCADE"),
account_code = db.Column(db.String, db.ForeignKey(BaseAccount.code,
ondelete="CASCADE"),
nullable=False, primary_key=True)
"""The code of the account."""
account = db.relationship(BaseAccount, back_populates="l10n")
@ -90,9 +88,8 @@ class Account(db.Model):
id = db.Column(db.Integer, nullable=False, primary_key=True,
autoincrement=False)
"""The account ID."""
base_code = db.Column(db.String,
db.ForeignKey(BaseAccount.code, onupdate="CASCADE",
ondelete="CASCADE"),
base_code = db.Column(db.String, db.ForeignKey(BaseAccount.code,
ondelete="CASCADE"),
nullable=False)
"""The code of the base account."""
base = db.relationship(BaseAccount, back_populates="accounts")
@ -106,9 +103,7 @@ class Account(db.Model):
created_at = db.Column(db.DateTime(timezone=True), nullable=False,
server_default=db.func.now())
"""The time of creation."""
created_by_id = db.Column(db.Integer,
db.ForeignKey(user_pk_column,
onupdate="CASCADE"),
created_by_id = db.Column(db.Integer, db.ForeignKey(user_pk_column),
nullable=False)
"""The ID of the creator."""
created_by = db.relationship(user_cls, foreign_keys=created_by_id)
@ -116,9 +111,7 @@ class Account(db.Model):
updated_at = db.Column(db.DateTime(timezone=True), nullable=False,
server_default=db.func.now())
"""The time of last update."""
updated_by_id = db.Column(db.Integer,
db.ForeignKey(user_pk_column,
onupdate="CASCADE"),
updated_by_id = db.Column(db.Integer, db.ForeignKey(user_pk_column),
nullable=False)
"""The ID of the updator."""
updated_by = db.relationship(user_cls, foreign_keys=updated_by_id)
@ -306,9 +299,8 @@ class Account(db.Model):
class AccountL10n(db.Model):
"""A localized account title."""
__tablename__ = "accounting_accounts_l10n"
account_id = db.Column(db.Integer,
db.ForeignKey(Account.id, onupdate="CASCADE",
ondelete="CASCADE"),
account_id = db.Column(db.Integer, db.ForeignKey(Account.id,
ondelete="CASCADE"),
nullable=False, primary_key=True)
account = db.relationship(Account, back_populates="l10n")
locale = db.Column(db.String, nullable=False, primary_key=True)