#NEWLINE# def __init__( self , * args , **kwargs ) : #NEWLINE# #INDENT# super ( EditAccountForm , self ) . __init__ ( * args , ** kwargs ) #NEWLINE# self . fields [ 'product_range' ] . help_text = 'You may need to create a product range first' #NEWLINE# deferred_income = AccountType . objects . get ( name = names . DEFERRED_INCOME ) #NEWLINE# types = deferred_income . get_children ( ) #NEWLINE# if ( types . count ( ) > 1 ) : #NEWLINE# #INDENT# self . fields [ 'account_type' ] = forms . ModelChoiceField ( queryset = kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( types . count ( ) == 1 ) : #NEWLINE# #INDENT# del self . fields [ 'account_type' ] #NEWLINE# self . _account_type = types [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise exceptions . ImproperlyConfigured ( "You need to define some 'deferred income' account types" )