Enhance model constructors; add optional parameters for improved initialization across multiple modelsOh

This commit is contained in:
Yaro Kasear 2025-06-23 15:42:48 -05:00
parent acacf39f8e
commit 8162038f40
10 changed files with 90 additions and 13 deletions

View file

@ -15,6 +15,9 @@ class Brand(db.Model):
inventory: Mapped[List['Inventory']] = relationship('Inventory', back_populates='brand')
def __init__(self, name: Optional[str] = None):
self.name = name
def __repr__(self):
return f"<Brand(id={self.id}, name={repr(self.name)})>"