draft: category tree building
This commit is contained in:
@@ -5,6 +5,7 @@ from pydantic import Field, computed_field
|
||||
from sqlalchemy import Date, ForeignKey, Index, Integer, String, UniqueConstraint
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from src.models.category import Category
|
||||
from src.models.common import Amount, ExportBaseModel, IngestdbBase, date2str, hashify
|
||||
|
||||
|
||||
@@ -29,7 +30,8 @@ class Transaction(ExportBaseModel):
|
||||
other_name: str | None = None
|
||||
other_iban: str | None = None
|
||||
# TODO: The Pydantic model should hold a category object, NOT the category id which is owned by the DB
|
||||
category_id: int | None = None
|
||||
category: Category | None
|
||||
category_id: int | None = None # remove!
|
||||
|
||||
@computed_field # type: ignore[prop-decorator]
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user