Skip to content

Commit 0e723fc

Browse files
committed
Added ProjectStatus Enum
1 parent 392148c commit 0e723fc

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/superannotate/lib/app/serializers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class ProjectSerializer(BaseSerializers):
7171
def serialize(self):
7272
data = super().serialize()
7373
data["type"] = constance.ProjectType.get_name(data["type"])
74+
if data.get("status"):
75+
data["status"] = constance.ProjectStatus.get_name(data["status"])
76+
else:
77+
data["status"] = "Undefined"
7478
if data.get("upload_state"):
7579
data["upload_state"] = constance.UploadState(data["upload_state"]).name
7680
if data.get("users"):

src/superannotate/lib/core/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from pathlib import Path
22

3+
from superannotate.lib.core.enums import ProjectStatus
34
from superannotate.lib.core.enums import AnnotationStatus
45
from superannotate.lib.core.enums import ImageQuality
56
from superannotate.lib.core.enums import ProjectType
@@ -127,6 +128,7 @@
127128
INVALID_JSON_MESSAGE = "Invalid json"
128129

129130
__alL__ = (
131+
ProjectStatus,
130132
ProjectType,
131133
UserRole,
132134
UploadState,

src/superannotate/lib/core/enums.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ class ImageQuality(BaseTitledEnum):
6262
COMPRESSED = "compressed", 60
6363

6464

65+
class ProjectStatus(BaseTitledEnum):
66+
NotStarted = "NotStarted", 1
67+
InProgress = "InProgress", 2
68+
Completed = "Completed", 3
69+
OnHold = "OnHold", 4
70+
71+
6572
class ExportStatus(BaseTitledEnum):
6673
IN_PROGRESS = "inProgress", 1
6774
COMPLETE = "complete", 2

0 commit comments

Comments
 (0)