|
6 | 6 | ) |
7 | 7 | from sqlalchemy.orm import Mapped, mapped_column |
8 | 8 |
|
9 | | -from constants import ( |
10 | | - COMPUTING_ID_LEN, |
11 | | - DISCORD_NICKNAME_LEN, |
12 | | -) |
13 | 9 | from database import Base |
14 | 10 | from elections.models import ( |
15 | 11 | ElectionStatusEnum, |
@@ -122,39 +118,3 @@ def status(self, at_time: datetime) -> str: |
122 | 118 | else: |
123 | 119 | return ElectionStatusEnum.AFTER_VOTING |
124 | 120 |
|
125 | | -class NomineeInfo(Base): |
126 | | - __tablename__ = "election_nominee_info" |
127 | | - |
128 | | - computing_id: Mapped[str] = mapped_column(String(COMPUTING_ID_LEN), primary_key=True) |
129 | | - full_name: Mapped[str] = mapped_column(String(64), nullable=False) |
130 | | - linked_in: Mapped[str] = mapped_column(String(128)) |
131 | | - instagram: Mapped[str] = mapped_column(String(128)) |
132 | | - email: Mapped[str] = mapped_column(String(64)) |
133 | | - discord_username: Mapped[str] = mapped_column(String(DISCORD_NICKNAME_LEN)) |
134 | | - |
135 | | - def to_update_dict(self) -> dict: |
136 | | - return { |
137 | | - "computing_id": self.computing_id, |
138 | | - "full_name": self.full_name, |
139 | | - |
140 | | - "linked_in": self.linked_in, |
141 | | - "instagram": self.instagram, |
142 | | - "email": self.email, |
143 | | - "discord_username": self.discord_username, |
144 | | - } |
145 | | - |
146 | | - def serialize(self) -> dict: |
147 | | - # NOTE: this function is currently the same as to_update_dict since the contents |
148 | | - # have a different invariant they're upholding, which may cause them to change if a |
149 | | - # new property is introduced. For example, dates must be converted into strings |
150 | | - # to be serialized, but must not for update dictionaries. |
151 | | - return { |
152 | | - "computing_id": self.computing_id, |
153 | | - "full_name": self.full_name, |
154 | | - |
155 | | - "linked_in": self.linked_in, |
156 | | - "instagram": self.instagram, |
157 | | - "email": self.email, |
158 | | - "discord_username": self.discord_username, |
159 | | - } |
160 | | - |
0 commit comments