<s> from changes . api . serializer import Crumbler , register <EOL> from changes . models import JobPhase <EOL> @ register ( JobPhase ) <EOL> class JobPhaseCrumbler ( Crumbler ) : <EOL> def crumble ( self , instance , attrs ) : <EOL> return { <EOL> '<STR_LIT:id>' : instance . id . hex , <EOL> '<STR_LIT:name>' : instance . label , <EOL> '<STR_LIT:result>' : instance . result , <EOL> '<STR_LIT:status>' : instance . status , <EOL> '<STR_LIT>' : instance . duration , <EOL> '<STR_LIT>' : instance . date_created , <EOL> '<STR_LIT>' : instance . date_started , <EOL> '<STR_LIT>' : instance . date_finished , <EOL> } <EOL> class JobPhaseWithStepsCrumbler ( JobPhaseCrumbler ) : <EOL> def crumble ( self , instance , attrs ) : <EOL> data = super ( JobPhaseWithStepsCrumbler , self ) . crumble ( instance , attrs ) <EOL> data [ '<STR_LIT>' ] = list ( instance . steps ) <EOL> return data </s>
