Skip to content

Commit

Permalink
*Remove emailing and background process
Browse files Browse the repository at this point in the history
*Add build-visibility
*Be able to delete, cancel, download pretranslations, and download the model from a build
  • Loading branch information
Enkidu93 committed Feb 29, 2024
1 parent 5bdf74b commit b3a2242
Show file tree
Hide file tree
Showing 5 changed files with 2,092 additions and 1,751 deletions.
16 changes: 9 additions & 7 deletions samples/ServalApp/db.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import enum

from sqlalchemy import Column, Enum, MetaData, String, create_engine
from sqlalchemy import Column, Enum, MetaData, String, DateTime, Boolean, create_engine
from sqlalchemy.orm import declarative_base


Expand All @@ -23,24 +23,26 @@ class Build(Base):
build_id = Column("build_id", String, primary_key=True)
engine_id = Column("engine_id", String, primary_key=True)
name = Column("name", String)
email = Column("email", String, nullable=False)
state = Column("state", Enum(State), nullable=False)
corpus_id = Column("corpus_id", String, nullable=False)
client_id = Column("client_id", String, nullable=False)
source_files = Column("source_files", String)
target_files = Column("target_files", String)
is_model_persisted = Column("is_model_persisted", Boolean)

def __str__(self):
return f"Build name: {self.name}\nBuild id: {self.build_id}\nClient ID: {self.client_id}\nSource files: \
{self.source_files}\nTarget files: {self.target_files}"
return f"Build name: {self.name}\nBuild id: {self.build_id}\nState: {self.state.name}\nClient ID: {self.client_id}\nSource files: \
{self.source_files}\nTarget files: {self.target_files}\nModelIsPersisted: {self.is_model_persisted}"

def __repr__(self):
return self.__str__()


class Param(Base):
__tablename__ = "params"
param_name = Column("param_name", String, primary_key=True)
class AuthToken(Base):
__tablename__ = "auth_tokens"
client_id = Column("client_id", String, primary_key=True)
token = Column("token", String)
exp_date = Column("exp_date", DateTime)


def create_db_if_not_exists():
Expand Down
Loading

0 comments on commit b3a2242

Please sign in to comment.