model-service/model_service/model/default.py
marcsello 284dfce735
All checks were successful
continuous-integration/drone/push Build is passing
Added ability to store CNN models
2020-07-28 20:19:52 +02:00

13 lines
471 B
Python

#!/usr/bin/env python3
from .db import db
from sqlalchemy.dialects.postgresql import UUID
from .aimodel import AIModelType
class Default(db.Model):
type = db.Column(db.Enum(AIModelType), unique=True, nullable=False, primary_key=True)
aimodel_id = db.Column(UUID(as_uuid=True), db.ForeignKey("ai_model.id"), nullable=False)
aimodel = db.relationship("AIModel", backref=db.backref("default", lazy=True, cascade="save-update, merge, delete, delete-orphan"))