v0.1
This commit is contained in:
		@@ -1,7 +1,7 @@
 | 
			
		||||
from enum import IntEnum, unique
 | 
			
		||||
 | 
			
		||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Boolean, Sequence
 | 
			
		||||
from sqlalchemy.orm import relationship
 | 
			
		||||
from sqlalchemy.orm import relationship, backref
 | 
			
		||||
 | 
			
		||||
from models.base import BaseModel, metadata
 | 
			
		||||
from models.utils import add_sequence_to_model
 | 
			
		||||
@@ -26,7 +26,7 @@ class Deal(BaseModel):
 | 
			
		||||
    current_status = Column(Integer, nullable=False, comment='Текущий статус')
 | 
			
		||||
 | 
			
		||||
    client_id = Column(Integer, ForeignKey('clients.id', ondelete='CASCADE'), nullable=False, comment='ID клиента')
 | 
			
		||||
    client = relationship('Client', backref='deals')
 | 
			
		||||
    client = relationship('Client', backref=backref('deals', cascade="all, delete-orphan"))
 | 
			
		||||
 | 
			
		||||
    status_history = relationship('DealStatusHistory', back_populates='deal', cascade="all, delete-orphan")
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user