mirror of
https://github.com/clearml/clearml-server
synced 2025-02-01 03:16:44 +00:00
baba8b5b73
Add initial support for project ordering Add support for sortable task duration (used by the UI in the experiment's table) Add support for project name in worker's current task info Add support for results and artifacts in pre-populates examples Add demo server features
47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
from mongoengine import StringField, DateTimeField, IntField
|
|
|
|
from database import Database, strict
|
|
from database.fields import StrippedStringField, SafeSortedListField
|
|
from database.model import AttributedDocument
|
|
from database.model.base import GetMixin
|
|
|
|
|
|
class Project(AttributedDocument):
|
|
|
|
get_all_query_options = GetMixin.QueryParameterOptions(
|
|
pattern_fields=("name", "description"),
|
|
list_fields=("tags", "system_tags", "id"),
|
|
)
|
|
|
|
meta = {
|
|
"db_alias": Database.backend,
|
|
"strict": strict,
|
|
"indexes": [
|
|
("company", "name"),
|
|
{
|
|
"name": "%s.project.main_text_index" % Database.backend,
|
|
"fields": ["$name", "$id", "$description"],
|
|
"default_language": "english",
|
|
"weights": {"name": 10, "id": 10, "description": 10},
|
|
},
|
|
],
|
|
}
|
|
|
|
id = StringField(primary_key=True)
|
|
name = StrippedStringField(
|
|
required=True,
|
|
unique_with=AttributedDocument.company.name,
|
|
min_length=3,
|
|
sparse=True,
|
|
)
|
|
description = StringField(required=True)
|
|
created = DateTimeField(required=True)
|
|
tags = SafeSortedListField(StringField(required=True))
|
|
system_tags = SafeSortedListField(StringField(required=True))
|
|
default_output_destination = StrippedStringField()
|
|
last_update = DateTimeField()
|
|
featured = IntField(default=9999)
|
|
logo_url = StringField()
|
|
logo_blob = StringField(exclude_by_default=True)
|
|
company_origin = StringField(exclude_by_default=True)
|