add from dict to symbol
This commit is contained in:
1 parent
a750653b3b
commit
34384ba828
1 file changed
+8
@@ -12,3 +12,11 @@ class Symbol(BaseModel):
|
||||
id: int
|
||||
label: str
|
||||
image: str # Base64-encoded PNG image data
|
||||
|
||||
|
||||
def from_dict(cls, data: dict) -> "Symbol":
|
||||
return cls(
|
||||
id=data["id"],
|
||||
label=data["label"],
|
||||
image=data["image"],
|
||||
)
|
||||
Reference in new issue
Block a user