16 lines
507 B
Python
16 lines
507 B
Python
|
|
from sqlalchemy import Column, Integer, ForeignKey
|
|
from sqlalchemy.orm import relationship
|
|
|
|
from database import Base
|
|
|
|
class Score(Base):
|
|
__tablename__ = "score"
|
|
id = Column(Integer, primary_key=True,autoincrement=True)
|
|
student_id = Column(Integer, ForeignKey("student.sid"),nullable=False)
|
|
exam_id = Column(Integer, nullable=False)
|
|
score = Column(Integer, nullable=False)
|
|
flag = Column(Integer,default=1,nullable=False)
|
|
student=relationship("Student",back_populates="scores")
|
|
|