if not self.datetime:
raise HandledException(f'Given date of wrong format: {self.date}')
- @classmethod
- def add(cls, db_conn: DatabaseConnection, date: str):
- """Add (or re-write) new Day(date) to database."""
- db_conn.exec('REPLACE INTO days VALUES (?)', (date,))
+ def save(self, db_conn: DatabaseConnection):
+ """Add (or re-write) self to database."""
+ db_conn.exec('REPLACE INTO days VALUES (?)', (self.date,))
@classmethod
def from_table_row(cls, row: Row):