You've already forked my-video-workflow
初次提交
This commit is contained in:
29
model/VideoPart.py
Normal file
29
model/VideoPart.py
Normal file
@ -0,0 +1,29 @@
|
||||
from datetime import datetime
|
||||
|
||||
from . import db
|
||||
|
||||
|
||||
class VideoPart(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
|
||||
base_path = db.Column(db.String(255), nullable=False)
|
||||
file = db.Column(db.String(255), nullable=False)
|
||||
remote_id = db.Column(db.String(255))
|
||||
name = db.Column(db.String(255))
|
||||
state = db.Column(db.SmallInteger, nullable=False, default=0)
|
||||
|
||||
workflow_id = db.Column(db.Integer, db.ForeignKey('workflow.id'))
|
||||
workflow = db.relationship("Workflow", uselist=False, backref=db.backref("video_parts", lazy="dynamic"))
|
||||
|
||||
posting_id = db.Column(db.Integer, db.ForeignKey('posting.id'))
|
||||
posting = db.relationship("Posting", backref=db.backref("video_parts", lazy="dynamic"), lazy=False)
|
||||
|
||||
def to_json(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"base_path": self.base_path,
|
||||
"file": self.file,
|
||||
"duration": self.duration,
|
||||
"remote_id": self.remote_id,
|
||||
"name": self.name,
|
||||
"state": self.state,
|
||||
}
|
Reference in New Issue
Block a user