#NEWLINE# def formfield( self , **kwargs ) : #NEWLINE# #INDENT# ' If this field has choices, then we can use a multiple choice field.\n            NB: The choices must be set on *this* field, e.g. this_field = ListField(CharField(), choices=x)\n            as opposed to: this_field = ListField(CharField(choices=x))\n        ' #NEWLINE# defaults = { #NEWLINE# #INDENT# 'required' : ( not self . blank ) , #NEWLINE# 'label' : capfirst ( self . verbose_name ) , #NEWLINE# 'help_text' : self . help_text , #NEWLINE# #UNINDENT# } #NEWLINE# if self . has_default ( ) : #NEWLINE# #INDENT# if callable ( self . default ) : #NEWLINE# #INDENT# defaults [ 'initial' ] = self . default #NEWLINE# defaults [ 'show_hidden_initial' ] = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# defaults [ 'initial' ] = self . get_default ( ) #NEWLINE# #UNINDENT# #UNINDENT# if self . choices : #NEWLINE# #INDENT# form_field_class = forms . MultipleChoiceField #NEWLINE# defaults [ 'choices' ] = self . get_choices ( include_blank = False ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# form_field_class = ListFormField #NEWLINE# #UNINDENT# defaults . update ( ** kwargs ) #NEWLINE# return form_field_class ( ** kwargs )