13 lines
455 B
Python
13 lines
455 B
Python
|
from sqlalchemy import Column, String, Boolean, ForeignKey, Enum, Text, DateTime, func, Integer
|
||
|
from Utils.SqlAlchemyUtils import Base
|
||
|
|
||
|
|
||
|
class Post(Base):
|
||
|
__tablename__ = "post"
|
||
|
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}
|