<s> from django import forms <EOL> class StepControlForm ( forms . Form ) : <EOL> skip_steps = forms . MultipleChoiceField ( choices = [ ] , required = False ) <EOL> desired_step = forms . ChoiceField ( choices = [ ] , required = False ) <EOL> def __init__ ( self , ** kwargs ) : <EOL> available_steps = kwargs . pop ( '<STR_LIT>' , [ ] ) <EOL> super ( StepControlForm , self ) . __init__ ( ** kwargs ) <EOL> self . fields [ '<STR_LIT>' ] . choices = available_steps <EOL> self . fields [ '<STR_LIT>' ] . choices = available_steps <EOL> class StepStatusForm ( forms . Form ) : <EOL> slug = forms . CharField ( ) <EOL> status = forms . CharField ( ) <EOL> can_skip = forms . BooleanField ( required = False ) <EOL> is_active = forms . BooleanField ( required = False ) <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . instance = kwargs . pop ( '<STR_LIT>' , None ) <EOL> super ( StepStatusForm , self ) . __init__ ( ** kwargs ) <EOL> if self . instance : <EOL> self . initial [ '<STR_LIT>' ] = self . instance . slug <EOL> self . initial [ '<STR_LIT:status>' ] = self . instance . status <EOL> self . initial [ '<STR_LIT>' ] = self . instance . can_skip ( ) <EOL> self . initial [ '<STR_LIT>' ] = self . instance . is_active ( ) <EOL> for key , datum in self . instance . get_extra_status_info ( ) . iteritems ( ) : <EOL> self . fields [ key ] = forms . CharField ( required = False ) <EOL> self . initial [ key ] = datum </s>
