MCPcopy Create free account
hub / github.com/chinobing/FastAPI-PaddleSpeech-Audio-To-Text / Audio

Class Audio

pstext/models.py:9–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7from .database import Base
8
9class Audio(Base):
10 __tablename__ = 'audio' # 数据表的表名
11
12 id = Column(Integer, primary_key=True, index=True, autoincrement=True)
13 title = Column(String(100), unique=True, nullable=False, comment='音频名称')
14 size = Column(String(100), comment='文件大小')
15 extension = Column(String(100), comment='文件类型')
16 progress = Column(Float, default=False, comment='进度')
17 data = relationship('Data', back_populates='audio') # 'Data'是关联的类名;back_populates来指定反向访问的属性名称
18 created_at = Column(DateTime, server_default=func.now(), comment='创建时间')
19
20 # __mapper_args__ = {"order_by": created_at} # 默认是正序,倒序加上.desc()方法
21
22 #读取数据后,显示出来的方式
23 def __repr__(self):
24 return f'{self.title}_{self.size}'
25
26
27class Data(Base):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected