From 528e2c668afc15de6e9cb12f307de7eae9bfff6a Mon Sep 17 00:00:00 2001 From: andrei Date: Fri, 4 Oct 2024 16:21:51 +0500 Subject: [PATCH] ._. --- app/infrastructure/database/models/cities.py | 2 +- app/infrastructure/database/models/statuses.py | 3 +-- app/infrastructure/database/models/total_orders.py | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/infrastructure/database/models/cities.py b/app/infrastructure/database/models/cities.py index 1130ba2..a4d3b91 100644 --- a/app/infrastructure/database/models/cities.py +++ b/app/infrastructure/database/models/cities.py @@ -14,4 +14,4 @@ class City(Base): federal_district = relationship('FederalDistrict', back_populates='cities') - accessories = relationship('City', back_populates='Accessory') + accessories = relationship('Accessory', back_populates='city') diff --git a/app/infrastructure/database/models/statuses.py b/app/infrastructure/database/models/statuses.py index 3eef693..ea66294 100644 --- a/app/infrastructure/database/models/statuses.py +++ b/app/infrastructure/database/models/statuses.py @@ -10,5 +10,4 @@ class Status(Base): id = Column(Integer, primary_key=True, autoincrement=True) name = Column(VARCHAR(100), nullable=False) - orders = relationship('Order', back_populates='status') - steps = relationship('Step', back_populates='status') + total_orders = relationship('TotalOrder', back_populates='status') diff --git a/app/infrastructure/database/models/total_orders.py b/app/infrastructure/database/models/total_orders.py index 2303e37..2a2124a 100644 --- a/app/infrastructure/database/models/total_orders.py +++ b/app/infrastructure/database/models/total_orders.py @@ -15,7 +15,7 @@ class TotalOrder(Base): user_id = Column(Integer, ForeignKey('users.id')) status_id = Column(Integer, ForeignKey('statuses.id')) - user = relationship('User', back_populates='orders') - status = relationship('Status', back_populates='orders') + user = relationship('User', back_populates='total_orders') + status = relationship('Status', back_populates='total_orders') - delivery_orders = relationship('DeliveryOrder', back_populates='total_orders') + delivery_orders = relationship('DeliveryOrder', back_populates='total_order')