usermod/Model/DepartmentModel.py

13 lines
473 B
Python
Raw Normal View History

2023-02-07 16:09:57 +08:00
from sqlalchemy import Column, String, Boolean, ForeignKey, Enum, Text, DateTime, func, Integer
from Utils.SqlAlchemyUtils import Base
class Department(Base):
__tablename__ = "DEPARTMENT_TABLE"
id = Column(Integer, primary_key=True, comment="部门id")
name = Column(String(32), comment="部门名称")
belong = Column(Integer, comment="上级部门")
def to_dict(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns}