DAS_2024_1/kashin_maxim_lab_3/faculty_service/db.py

15 lines
401 B
Python

from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Faculty(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(100), nullable=False)
university_id = db.Column(db.Integer, nullable=False)
def to_dict(self):
return {
"id": self.id,
"name": self.name,
"university_id": self.university_id
}