mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
feat: add free-form tags on transactions
Third of the four ideas picked from the Maybe/Sure feature audit. Tags are orthogonal to categories (category = what kind of spend, tag = which event/project) — many-to-many, created inline while typing in the transaction form, filterable from the Transactions page. Also adds tests/test_backup.py, the first test coverage the backup export/import path has ever had, and fixes a MissingGreenlet bug it surfaced in restore_backup's tag-wiring. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from app.db.base import Base
|
||||
from app.models.enums import TransactionType
|
||||
from app.models.mixins import TimestampMixin
|
||||
from app.models.tag import transaction_tags
|
||||
|
||||
|
||||
class Transaction(Base, TimestampMixin):
|
||||
@@ -33,3 +34,4 @@ class Transaction(Base, TimestampMixin):
|
||||
account: Mapped["Account"] = relationship(back_populates="transactions", foreign_keys=[account_id])
|
||||
transfer_account: Mapped["Account | None"] = relationship(foreign_keys=[transfer_account_id])
|
||||
category: Mapped["Category | None"] = relationship(back_populates="transactions")
|
||||
tags: Mapped[list["Tag"]] = relationship(secondary=transaction_tags, back_populates="transactions")
|
||||
|
||||
Reference in New Issue
Block a user