mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-06 10:09:52 +02:00
Support collections with row tags.
This commit is contained in:
parent
6842a1b898
commit
6699e66957
1 changed files with 12 additions and 1 deletions
|
@ -45,6 +45,9 @@ class Collection:
|
||||||
# List of tag values to be used in columns
|
# List of tag values to be used in columns
|
||||||
column_values: list[str] = field(default_factory=list)
|
column_values: list[str] = field(default_factory=list)
|
||||||
|
|
||||||
|
# List of tags to be used in rows
|
||||||
|
row_tags: list[Tags] = field(default_factory=list)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def deserialize(cls, structure: dict[str, Any]):
|
def deserialize(cls, structure: dict[str, Any]):
|
||||||
"""Deserialize icon collection from structure."""
|
"""Deserialize icon collection from structure."""
|
||||||
|
@ -60,8 +63,16 @@ class Collection:
|
||||||
column_values: list[str] = (
|
column_values: list[str] = (
|
||||||
structure["column_values"] if "column_values" in structure else []
|
structure["column_values"] if "column_values" in structure else []
|
||||||
)
|
)
|
||||||
|
row_tags: list[Tags] = (
|
||||||
|
structure["row_tags"] if "row_tags" in structure else []
|
||||||
|
)
|
||||||
return cls(
|
return cls(
|
||||||
structure["tags"], row_key, row_values, column_key, column_values
|
structure["tags"],
|
||||||
|
row_key,
|
||||||
|
row_values,
|
||||||
|
column_key,
|
||||||
|
column_values,
|
||||||
|
row_tags,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue