From dbc12e39226e520253e450779fe20b17adbcbad5 Mon Sep 17 00:00:00 2001 From: wolin_ck666_999 Date: Tue, 22 Sep 2026 13:18:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=E3=80=8Cmodel=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/student_model.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 model/student_model.py diff --git a/model/student_model.py b/model/student_model.py new file mode 100644 index 0000000..9b2c8bf --- /dev/null +++ b/model/student_model.py @@ -0,0 +1,25 @@ +from database import Base +from sqlalchemy import Column,Integer,String,Date,Boolean, Enum as SQLEnum +from enum import Enum +class Sex(Enum): + m= "男" + w= "女" +class Student(Base): + __tablename__ = 's_student' + id=Column(Integer, primary_key=True,autoincrement=True,comment="数据库主键id") + stu_id=Column(String(50),unique=True,nullable=False,comment='学生id') + class_id=Column(String(50),#ForeignKey=("s_class.class_id"), + comment='学生班级') + stu_name=Column(String(30),nullable=False,comment='学生姓名') + native_place = Column(String(100), comment="籍贯") + graduate_school = Column(String(100), comment="毕业院校") + major = Column(String(50), comment="专业") + enroll_date = Column(Date, comment="入学时间") + graduate_date = Column(Date, comment="毕业时间") + education = Column(String(30), comment="学历") + advisor_no = Column(String(50), comment="顾问编号") + age = Column(Integer, comment="年龄") + gender = Column( + SQLEnum(Sex, values_callable=lambda x: [e.value for e in x]), + comment="性 别") + is_deleted = Column(Boolean, default=False, comment="逻辑删除标记:False未删除,True已删除") \ No newline at end of file