mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
Fix Task.archived_tag read-only property does not work (issue #274)
This commit is contained in:
parent
504dfd8f32
commit
c28f8cf65b
@ -27,7 +27,6 @@ from collections import OrderedDict
|
|||||||
from six.moves.urllib.parse import quote
|
from six.moves.urllib.parse import quote
|
||||||
|
|
||||||
from ...utilities.locks import RLock as FileRLock
|
from ...utilities.locks import RLock as FileRLock
|
||||||
from ...utilities.attrs import readonly
|
|
||||||
from ...utilities.proxy_object import verify_basic_type
|
from ...utilities.proxy_object import verify_basic_type
|
||||||
from ...binding.artifacts import Artifacts
|
from ...binding.artifacts import Artifacts
|
||||||
from ...backend_interface.task.development.worker import DevWorker
|
from ...backend_interface.task.development.worker import DevWorker
|
||||||
@ -63,7 +62,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
|
|||||||
|
|
||||||
_anonymous_dataview_id = '__anonymous__'
|
_anonymous_dataview_id = '__anonymous__'
|
||||||
_development_tag = 'development'
|
_development_tag = 'development'
|
||||||
archived_tag = readonly('archived')
|
archived_tag = 'archived'
|
||||||
_default_configuration_section_name = 'General'
|
_default_configuration_section_name = 'General'
|
||||||
_legacy_parameters_section_name = 'Args'
|
_legacy_parameters_section_name = 'Args'
|
||||||
_force_requirements = {}
|
_force_requirements = {}
|
||||||
|
@ -3076,7 +3076,8 @@ class Task(_Task):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
res_tasks = res.response.tasks
|
res_tasks = res.response.tasks
|
||||||
# if we have more than one result, first filter 'archived' results:
|
# if we have more than one result, filter out the 'archived' results
|
||||||
|
# notice that if we only have one result we do get the archived one as well.
|
||||||
if len(res_tasks) > 1:
|
if len(res_tasks) > 1:
|
||||||
filtered_tasks = [t for t in res_tasks if not getattr(t, system_tags, None) or
|
filtered_tasks = [t for t in res_tasks if not getattr(t, system_tags, None) or
|
||||||
cls.archived_tag not in getattr(t, system_tags, None)]
|
cls.archived_tag not in getattr(t, system_tags, None)]
|
||||||
|
@ -16,7 +16,3 @@ class attrs(object):
|
|||||||
|
|
||||||
def __call__(self, f):
|
def __call__(self, f):
|
||||||
return attr.attrs(*self.args, **self.kwargs)(f)
|
return attr.attrs(*self.args, **self.kwargs)(f)
|
||||||
|
|
||||||
|
|
||||||
def readonly(value):
|
|
||||||
return property(lambda self: value)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user