usermod/Model/PostModel.py

13 lines
470 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 Post(Base):
__tablename__ = "POST_TABLE"
id = Column(Integer, primary_key=True, comment="职务id")
name = Column(String(32), comment="职务名称")
2023-02-09 10:54:07 +08:00
default_auth = Column(Text, comment="职务默认权限")
2023-02-07 16:09:57 +08:00
def to_dict(self):
return {c.name: getattr(self, c.name) for c in self.__table__.columns}