forked from wolin_ck666_999/StuManagerSys
25 lines
1.2 KiB
Python
25 lines
1.2 KiB
Python
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已删除")
|