mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
added id to legacy item
This commit is contained in:
parent
24ebd76bd9
commit
3bdaf89a79
1 changed files with 9 additions and 1 deletions
|
|
@ -862,18 +862,26 @@ class LegacyInstancesItem(object):
|
|||
"""
|
||||
|
||||
def __init__(self, identifier, label):
|
||||
self._id = str(uuid4())
|
||||
self.identifier = identifier
|
||||
self.label = label
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
return self._id
|
||||
|
||||
def to_data(self):
|
||||
return {
|
||||
"id": self.id,
|
||||
"identifier": self.identifier,
|
||||
"label": self.label
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def from_data(cls, data):
|
||||
return cls(data["identifier"], data["label"])
|
||||
obj = cls(data["identifier"], data["label"])
|
||||
obj._id = data["id"]
|
||||
return obj
|
||||
|
||||
|
||||
class CreateContext:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue