88 OneToOneField ,
99 ForeignKey )
1010
11+ from activflow .core .constants import (
12+ REQUEST_STATUS ,
13+ TASK_STATUS )
14+
1115from activflow .core .helpers import (
1216 flow_config ,
13- transition_config
14- )
17+ transition_config )
1518
1619
1720class AbstractEntity (Model ):
@@ -54,10 +57,8 @@ class Request(AbstractEntity):
5457 """Defines the workflow request"""
5558 requester = ForeignKey (User , related_name = 'requests' )
5659 module_ref = CharField (max_length = 100 )
57- status = CharField (verbose_name = "Status" , max_length = 30 , choices = (
58- ('Initiated' , 'Initiated' ),
59- ('Withdrawn' , 'Withdrawn' ),
60- ('Completed' , 'Completed' )))
60+ status = CharField (
61+ verbose_name = "Status" , max_length = 30 , choices = REQUEST_STATUS )
6162
6263
6364class Task (AbstractEntity ):
@@ -66,11 +67,8 @@ class Task(AbstractEntity):
6667 assignee = ForeignKey (Group )
6768 updated_by = ForeignKey (User )
6869 activity_ref = CharField (max_length = 100 )
69- status = CharField (verbose_name = "Status" , max_length = 30 , choices = (
70- ('Not Started' , 'Not Started' ),
71- ('In Progress' , 'In Progress' ),
72- ('Rolled Back' , 'Rolled Back' ),
73- ('Completed' , 'Completed' )))
70+ status = CharField (
71+ verbose_name = "Status" , max_length = 30 , choices = TASK_STATUS )
7472
7573 @property
7674 def activity (self ):
0 commit comments