27 lines
713 B
Python
27 lines
713 B
Python
import schema
|
|
|
|
class App_State :
|
|
|
|
user_id = None
|
|
|
|
Action_Kind = \
|
|
{ 1 : "Create Order"
|
|
, 10 : "Change owner"
|
|
, 20 : "IMOS CAD started"
|
|
, 25 : "IMOS CAD closed"
|
|
}
|
|
@classmethod
|
|
def Create_Action (cls, kind, text, order = None) :
|
|
if kind not in cls. Action_Kind :
|
|
raise ValueError (f"Unknow action kind {kind}")
|
|
schema.Action \
|
|
( user = cls.user_id
|
|
, date = schema.datetime.now ()
|
|
, action_kind = kind
|
|
, action = text
|
|
, order = order
|
|
)
|
|
# end def create_action
|
|
|
|
# end class App_State
|