2020-04-14 02:01:44 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
from .db import db
|
2020-04-14 13:48:11 +02:00
|
|
|
from sqlalchemy.dialects.postgresql import UUID
|
2020-04-14 02:01:44 +02:00
|
|
|
|
2020-07-28 20:19:52 +02:00
|
|
|
from .aimodel import AIModelType
|
2020-04-14 02:01:44 +02:00
|
|
|
|
2020-04-14 17:03:15 +02:00
|
|
|
class Default(db.Model):
|
2020-07-28 20:19:52 +02:00
|
|
|
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)
|
2020-04-14 17:26:33 +02:00
|
|
|
aimodel = db.relationship("AIModel", backref=db.backref("default", lazy=True, cascade="save-update, merge, delete, delete-orphan"))
|
2020-07-28 20:19:52 +02:00
|
|
|
|