Refactor code structure; improve organization and readability across multiple files
This commit is contained in:
parent
774c28e761
commit
acacf39f8e
14 changed files with 380 additions and 217 deletions
|
@ -17,4 +17,11 @@ class Item(db.Model):
|
|||
inventory: Mapped[List['Inventory']] = relationship('Inventory', back_populates='item')
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Item(id={self.id}, description={repr(self.description)}, category={repr(self.category)})>"
|
||||
return f"<Item(id={self.id}, description={repr(self.description)}, category={repr(self.category)})>"
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
'name': self.description,
|
||||
'category': self.category
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue