From c4996cf8d264ecc83f905109551e3607e3e088f5 Mon Sep 17 00:00:00 2001 From: ydb5755 Date: Mon, 30 Sep 2024 11:22:23 +0300 Subject: [PATCH] show vendor name --- app/models.py | 3 +++ app/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index 7cf8c37..7576751 100644 --- a/app/models.py +++ b/app/models.py @@ -12,6 +12,9 @@ class Vendor(db.Model): def get_line_items(self): return db.session.execute(select(LineItem).where(LineItem.vendor_id==self.id)).all() + + def __repr__(self) -> str: + return f'{self.name}' class BudgetCategory(db.Model): __tablename__ = 'budget_category' diff --git a/app/templates/index.html b/app/templates/index.html index d9a2bde..bce6c2a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -65,7 +65,7 @@ {{li[0].parent_line_item_id}} {{li[0].amount}} {{li[0].currency_type}} - {{li[0].vendor_id}} + {{li[0].get_vendor()[0]}} {{li[0].date}} {{li[0].confirmation_code}} {{li[0].note}}