class Studying(db.Entity): id = PrimaryKey(int, auto=True) beginning_time = Required(time) date = Required(date) klas = Optional('Klas') syllabus = Optional('Syllabus') subjects = Set(Subject)
class Klas(db.Entity): id = PrimaryKey(int, auto=True) date = Required(datetime) number = Required(int) letter = Required(str) direction = Required(Direction) syllabus = Required(Syllabus) studying = Optional(Studying) students = Set(Student)
class UserSetting(db.Entity): id = PrimaryKey(int, auto=False, size=64) # Telegram User ID lang = Optional(str, default='en') # The language setting for this user stats = Optional(bool, default=False) # Opt-in to keep game statistics first_places = Optional(int, default=0) # Nr. of games won in first place games_played = Optional(int, default=0) # Nr. of games completed cards_played = Optional(int, default=0) # Nr. of cards played total use_keyboards = Optional(bool, default=False) # Use keyboards (unused)
class Syllabus(db.Entity): id = PrimaryKey(int, auto=True) klas = Optional('Klas') start = Required(date) finish = Required(date) studyings = Set(Studying)
class Direction(db.Entity): id = PrimaryKey(int, auto=True) klas = Optional('Klas', cascade_delete=True) name = Required(str)
class Subject(db.Entity): id = PrimaryKey(int, auto=True) topic = Optional('Topic', reverse='subjects') name = Required(str) teacher = Required(Teacher) schedule = Optional('Studying', reverse='subjects')