2022-12-20 05:59:35 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-12-20 07:28:45 +00:00
|
|
|
from dataclasses import dataclass
|
2022-12-20 07:23:52 +00:00
|
|
|
from typing import TYPE_CHECKING
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
2022-12-20 07:28:45 +00:00
|
|
|
from backend.model.tribe import Tribe
|
2022-12-20 05:59:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
@dataclass
|
|
|
|
class Student:
|
|
|
|
def __init__(self, id: str, name: str, tribe: Tribe) -> None:
|
|
|
|
self.id = id
|
|
|
|
self.name = name
|
|
|
|
self.tribe = tribe
|
|
|
|
|
|
|
|
self.tribe.register_student(self)
|
|
|
|
|
|
|
|
def __eq__(self, other: object) -> bool:
|
|
|
|
if isinstance(other, Student):
|
|
|
|
return self.id == other.id
|
|
|
|
return False
|