This is primarily meant to be used via 3rd party applications (like the Blender Cloud). The external software requires a bundle, and if was already build it gets served a local filesystem path, that can be further used. Otherwise the bundle is built.
29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
import datetime
|
|
from application import db
|
|
|
|
|
|
class Bundle(db.Model):
|
|
"""Bundles are the results of a 'bam bundle' command. When running such command
|
|
for the first time we:
|
|
- create a task in the queue (see the queue module)
|
|
- create a bundle entry and set its status as 'waiting'
|
|
- executed the task (at due time)
|
|
- set the bundle entry status to 'building'
|
|
- once completed we set the status to 'available'
|
|
- serve the bundle_path
|
|
|
|
The bundle_path can be used but an application that shares access to the BAM
|
|
storage, as well as by the 'bam checkout' command itself (later on).
|
|
|
|
If this is not the case, we will provide a working download link via the 'bam info'.
|
|
"""
|
|
id = db.Column(db.Integer, primary_key=True)
|
|
source_file_path = db.Column(db.String(512), nullable=False)
|
|
bundle_path = db.Column(db.String(512))
|
|
status = db.Column(db.String(80))
|
|
creation_date = db.Column(db.DateTime(), default=datetime.datetime.now)
|
|
update_date = db.Column(db.DateTime(), default=datetime.datetime.now)
|
|
|
|
def __str__(self):
|
|
return str(self.name)
|