mirror of
https://github.com/clearml/clearml
synced 2025-03-03 18:52:12 +00:00
Add original_task
property to models
Change `task` property to return connected task
This commit is contained in:
parent
a59b40217e
commit
fa0ba104c4
@ -324,11 +324,22 @@ class BaseModel(object):
|
||||
def task(self):
|
||||
# type: () -> str
|
||||
"""
|
||||
Return the creating task ID
|
||||
Return the task ID connected to this model. If not task is connected,
|
||||
return the ID of the task that originally created this model.
|
||||
|
||||
:return: The Task ID (str)
|
||||
"""
|
||||
return self._task.id if self._task else self._get_base_model().task
|
||||
return self._task.id if self._task else self.original_task
|
||||
|
||||
@property
|
||||
def original_task(self):
|
||||
# type: () -> str
|
||||
"""
|
||||
Return the ID of the task that created this model.
|
||||
|
||||
:return: The Task ID (str)
|
||||
"""
|
||||
return self._get_base_model().task
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
|
Loading…
Reference in New Issue
Block a user