clearml-server/apiserver/database/model/version.py

19 lines
657 B
Python
Raw Normal View History

from mongoengine import Document, DateTimeField, StringField
2021-01-05 14:28:49 +00:00
from apiserver.database import Database, strict
from apiserver.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()