from . import base
from . import database
from . import jobs
+from . import uploads
from .decorators import *
from .errors import *
})
+ # Uploads
+
+ def get_uploads(self):
+ """
+ Returns all uploads that belong to this builder
+ """
+ stmt = (
+ sqlalchemy
+ .select(uploads.Upload)
+ .where(
+ uploads.Upload.builder == self,
+ uploads.Upload.expires_at > sqlalchemy.func.current_timestamp(),
+ )
+ .order_by(
+ uploads.Upload.created_at.desc(),
+ )
+ )
+
+ return self.db.fetch(stmt)
+
+
class BuilderStats(base.Object):
def init(self, builder, data):
self.builder = builder