-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement report backend storage
- Loading branch information
Showing
22 changed files
with
1,094 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
"""Types for Zeno reports.""" | ||
from enum import Enum | ||
|
||
from zeno_backend.classes.base import CamelModel | ||
|
||
|
||
class ReportElementType(Enum): | ||
"""Enumeration of possible report types in Zeno. | ||
Attributes: | ||
CHART: Chart element for a report. | ||
TEXT: Text element for a report. | ||
""" | ||
|
||
CHART = "CHART" | ||
TEXT = "TEXT" | ||
|
||
|
||
class Report(CamelModel): | ||
"""Representation of a report in Zeno. | ||
Attributes: | ||
id (int): ID of the report. | ||
name (str): name of the report. | ||
owner_name (str): name of the creater of the report | ||
linked_projects (list[str]): all projects that can be used with the report. | ||
editor (bool): whether the current user can edit the report. | ||
public (bool): whether the report is publically visible. | ||
""" | ||
|
||
id: int | ||
name: str | ||
owner_name: str | ||
linked_projects: list[str] | ||
editor: bool | ||
public: bool = False | ||
|
||
|
||
class ReportElement(CamelModel): | ||
"""Representation of an element of a Zeno report. | ||
Attributes: | ||
type (ReportElementType): what type of element this represents. | ||
data (str | None): any data that the element holds. | ||
chart_id (int | None): id of the chart this element is linked to. | ||
""" | ||
|
||
id: int | ||
type: ReportElementType | ||
data: str | None | ||
chart_id: int | None | ||
position: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.