带有主键sqlalchemy的默认值

2024-04-20 11:46:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我有下面的课

class Comision(Base):
    __tablename__ = 'comision'

    id = Column(Integer, primary_key=True)
    key = Column(Integer, default=process())

在列键中我有def process,我需要对该表的主键进行一些操作,是否可以像参数一样传递它?在


Tags: keyidtruedefaultbasedefcolumninteger