This repository has been archived on 2023-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-asset-manager/webservice/bam/application/modules/resources/model.py
Francesco Siddi 0f80f31ac4 Support for the bundle command
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.
2015-01-12 18:36:38 +01:00

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)