feat: attrs on product
This commit is contained in:
@@ -8,10 +8,18 @@ class Client(BaseModel):
|
||||
__tablename__ = 'clients'
|
||||
id = Column(Integer, autoincrement=True, primary_key=True, index=True)
|
||||
name = Column(String, nullable=False, unique=True, comment='Название клиента')
|
||||
|
||||
# TODO replace with additional model
|
||||
company_name = Column(String,
|
||||
nullable=False,
|
||||
server_default='',
|
||||
comment='Название компании')
|
||||
|
||||
created_at = Column(DateTime, nullable=False, comment='Дата создания')
|
||||
|
||||
products = relationship('Product', back_populates='client')
|
||||
details = relationship('ClientDetails', uselist=False, back_populates='client', cascade='all, delete')
|
||||
details = relationship('ClientDetails', uselist=False, back_populates='client', cascade='all, delete',
|
||||
lazy='joined')
|
||||
|
||||
barcode_template_id = Column(Integer, ForeignKey('barcode_templates.id'), nullable=True)
|
||||
barcode_template = relationship('BarcodeTemplate', lazy='selectin')
|
||||
|
||||
Reference in New Issue
Block a user