mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 10:56:48 +00:00
19 lines
657 B
Python
19 lines
657 B
Python
from mongoengine import Document, DateTimeField, StringField
|
|
|
|
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()
|