clearml-server/apiserver/database/model/version.py
2021-01-05 16:22:34 +02:00

19 lines
637 B
Python

from mongoengine import Document, DateTimeField, StringField
from database import Database, strict
from database.model import DbModelMixin
class Version(DbModelMixin, Document):
meta = {
"collection": "versions", # custom collection name ('version' is not a proper collection name...)
"db_alias": Database.backend, # although we'll use this model for all databases, a default must be defined
"strict": strict,
"indexes": [("-created", "-num")],
}
id = StringField(primary_key=True)
num = StringField(required=True)
created = DateTimeField(required=True)
desc = StringField()