#NEWLINE# def check_for_chooser( holder , field ) : #NEWLINE# #INDENT# if isinstance ( field , fields . DummyField ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# methname = ( field . name + '_choices' ) #NEWLINE# m = getattr ( holder , methname , None ) #NEWLINE# if ( m is not None ) : #NEWLINE# #INDENT# ch = Chooser ( m , field , m ) #NEWLINE# d = holder . __dict__ . get ( '_choosers_dict' , None ) #NEWLINE# if ( d is None ) : #NEWLINE# #INDENT# d = dict ( ) #NEWLINE# setattr ( holder , '_choosers_dict' , d ) #NEWLINE# #UNINDENT# if ( ch in d ) : #NEWLINE# #INDENT# raise Exception ( ( 'Redefinition of chooser %s' % field ) ) #NEWLINE# #UNINDENT# d [ field . name ] = ch