sort laboratory list by name and hide numeric id.
This commit is contained in:
@ -28,6 +28,9 @@ class Laboratories:
|
||||
def append(self, item: Laboratory) -> None:
|
||||
self.items.append(item)
|
||||
|
||||
def sort(self) -> None:
|
||||
self.items.sort(key=lambda x: x.name)
|
||||
|
||||
def find_by_id(self, id: int) -> Laboratory | None:
|
||||
return next((x for x in self.items if x.id == id), None)
|
||||
|
||||
|
Reference in New Issue
Block a user