Enhance model constructors; add optional parameters for improved initialization across multiple modelsOh
This commit is contained in:
parent
acacf39f8e
commit
8162038f40
10 changed files with 90 additions and 13 deletions
|
@ -15,6 +15,9 @@ class Area(db.Model):
|
|||
|
||||
rooms: Mapped[List['Room']] = relationship('Room', back_populates='area')
|
||||
|
||||
def __init__(self, name: Optional[str] = None):
|
||||
self.name = name
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Area(id={self.id}, name={repr(self.name)})>"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue