#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# 'Build form layout dynamically.' #NEWLINE# super ( InstructorsForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# only = Airport . objects . distinct ( ) . values_list ( 'country' , flat = True ) #NEWLINE# only = [ c for c in only if choices ] #NEWLINE# countries = Countries ( ) #NEWLINE# countries . only = only #NEWLINE# choices = list ( countries ) #NEWLINE# self . fields [ 'country' ] = forms . MultipleChoiceField ( choices = choices , required = False ) #NEWLINE# self . helper = FormHelper ( self ) #NEWLINE# self . helper . form_class = 'form-inline' #NEWLINE# self . helper . form_method = 'get' #NEWLINE# self . helper . layout = Layout ( Div ( Div ( 'latitude' , 'longitude' , css_class = 'panel-body' ) , css_class = 'panel panel-default ' ) , HTML ( '<p>OR</p>' ) , Div ( Div ( 'airport' , css_class = 'panel-body' ) , css_class = 'panel panel-default ' ) , HTML ( '<p>OR</p>' ) , Div ( Div ( 'country' , css_class = 'panel-body' ) , css_class = 'panel panel-default ' ) , 'gender' , 'lessons' , 'instructor_badges' , FormActions ( Submit ( 'submit' , 'Submit' ) ) )