class laborator(db.Model): __tablename__ = 'laborator' id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(70), unique=True, nullable=False) content = db.Column(db.String(500), unique=False, nullable=False) year = db.Column(db.Integer, unique=False, nullable=False) group = db.Column(db.String(5), unique=False, nullable=False) def __repr__(self): return f"\n Laborator: \n id: {self.id}\n title: {self.title} \n content: {self.content}\n year: {self.year}" \ f"\n group: {self.group} \n"
class grade(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(70), unique=True, nullable=False) value = db.Column(db.Float(3), unique=False, nullable=False) def __repr__(self): return f"\nGrade: \n id: {self.id}\n title: {self.title} \n value: {self.value}\n"
class cursuri(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(70), unique=True, nullable=False) an = db.Column(db.Integer, unique=False, nullable=False) semestru = db.Column(db.Integer, unique=False, nullable=False) def __repr__(self): return f"\nCurs: \n id: {self.id}\n title: {self.title} \n an: {self.an}\n semestru: {self.semestru}\n"
class studenti(db.Model, UserMixin): __tablename__ = 'studenti' id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(60), unique=True, nullable=False) name = db.Column(db.VARCHAR(121), unique=True, nullable=False) password = db.Column(db.VARCHAR(121), unique=False, nullable=False) nr_matricol = db.Column(db.String(16), unique=True, nullable=False) type = db.Column(db.String(9), unique=False, nullable=False) year = db.Column(db.Integer, unique=False, nullable=False) group = db.Column(db.String(5), unique=False, nullable=False) homeworks = db.Column(MutableList.as_mutable(ARRAY(db.String)), unique=False, nullable=True) marks = db.Column(MutableList.as_mutable(ARRAY(db.Integer)), unique=False, nullable=True) date = db.Column(MutableList.as_mutable(ARRAY(db.String)), unique=False, nullable=True) absence = db.Column(MutableList.as_mutable(ARRAY(db.String)), unique=False, nullable=True) def set_password(self, password): self.password = generate_password_hash(password, method='sha256') def check_password(self, password): return check_password_hash(self.password, password) def __repr__(self): return f"\n Student_User: \n id: {self.id}\n email: {self.email} \n name: {self.name}" \ f"\n nr_matricol: {self.nr_matricol}\n type: {self.type} \n year: {self.year}\n group: {self.group}" \ f"\n homeworks: {self.homeworks}" \ f"\n marks: {self.marks}" \ f"\n marks: {self.marks}" \ f"\n date: {self.date}" \ f"\n absence: {self.absence} \n "
class FileContents(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(300), unique=True, nullable=False) data = db.Column(db.LargeBinary, unique=True, nullable=False)