<s> from . . util import ( <EOL> postorder , <EOL> get_content_type , <EOL> ) <EOL> from . . event import subscribe_added <EOL> @ subscribe_added ( ) <EOL> def init_workflows_for_object ( event ) : <EOL> """<STR_LIT>""" <EOL> if event . moving is not None : <EOL> return <EOL> added = event . object <EOL> registry = event . registry <EOL> for obj in postorder ( added ) : <EOL> content_type = get_content_type ( obj ) <EOL> if content_type is not None : <EOL> for wf in registry . workflow . get_all_types ( content_type ) : <EOL> if not wf . has_state ( obj ) : <EOL> wf . initialize ( obj ) </s>
