chenzhaoyang
2025-12-17 063da0bf961e1d35e25dc107f883f7492f4c5a7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""
FSM state choices registry system.
 
This module provides the infrastructure for registering and managing
state choices for different entity types in the FSM framework.
"""
 
from django.db import models
from django.utils.translation import gettext_lazy as _
from fsm.registry import register_state_choices
 
"""
Core state choice enums for Label Studio entities.
These enums define the essential states for core Label Studio entities.
"""
 
 
@register_state_choices('task')
class TaskStateChoices(models.TextChoices):
    """
    Core task states for basic Label Studio workflow.
    Simplified states covering the essential task lifecycle:
    - Creation and assignment
    - Annotation work
    - Completion
    """
 
    # Initial State
    CREATED = 'CREATED', _('Created')
 
    # Work States
    IN_PROGRESS = 'IN_PROGRESS', _('In Progress')
 
    # Terminal State
    COMPLETED = 'COMPLETED', _('Completed')
 
 
@register_state_choices('annotation')
class AnnotationStateChoices(models.TextChoices):
    """
    Core annotation states for basic Label Studio workflow.
    Simplified states covering the essential annotation lifecycle:
    - Submission
    - Completion
    """
 
    # Working States
    SUBMITTED = 'SUBMITTED', _('Submitted')
 
    # Terminal State
    COMPLETED = 'COMPLETED', _('Completed')
 
 
@register_state_choices('project')
class ProjectStateChoices(models.TextChoices):
    """
    Core project states for basic Label Studio workflow.
    Simplified states covering the essential project lifecycle:
    - Setup and configuration
    - Active work
    - Completion
    """
 
    # Setup States
    CREATED = 'CREATED', _('Created')
 
    # Work States
    IN_PROGRESS = 'IN_PROGRESS', _('In Progress')
 
    # Terminal State
    COMPLETED = 'COMPLETED', _('Completed')