othr
This commit is contained in:
		@@ -12,4 +12,12 @@ class Product(BaseModel):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID сделки')
 | 
					    client_id = Column(Integer, ForeignKey('clients.id'), nullable=False, comment='ID сделки')
 | 
				
			||||||
    client = relationship('Client', back_populates='products')
 | 
					    client = relationship('Client', back_populates='products')
 | 
				
			||||||
 | 
					    barcodes = relationship('ProductBarcode', back_populates='product')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class ProductBarcode(BaseModel):
 | 
				
			||||||
 | 
					    __tablename__ = 'product_barcodes'
 | 
				
			||||||
 | 
					    product_id = Column(Integer, ForeignKey('products.id'), nullable=False, comment='ID товара', primary_key=True)
 | 
				
			||||||
 | 
					    product = relationship('Product', back_populates='barcodes')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    barcode = Column(String, nullable=False, index=True, comment='ШК товара')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user