12345678910111213141516171819202122 |
- from sqlalchemy import Column, Integer, String, DateTime
- from .base_model import BaseModel, CreateModel, UpdateModel, DeleteModel
- class ExamModel(BaseModel, CreateModel, UpdateModel, DeleteModel):
- """
- 考试模型
- 对应数据库表: exams
- """
- __tablename__ = 'exams'
- name = Column(String(100), nullable=False, comment='考试名称')
- description = Column(String(500), comment='考试描述')
- subject = Column(String(50), nullable=False, comment='所属学科')
- total_score = Column(Integer, nullable=False, comment='总分')
- duration = Column(Integer, nullable=False, comment='考试时长(分钟)')
- start_time = Column(DateTime, nullable=False, comment='开始时间')
- end_time = Column(DateTime, nullable=False, comment='结束时间')
- status = Column(String(20), nullable=False, comment='状态')
- def __repr__(self):
- return f"<Exam(id={self.id}, name={self.name}, subject={self.subject})>"
|