#NEWLINE# def __new__( cls , name , bases , attrs ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# parents = [ b for b in bases if issubclass ( b , EntityForm ) ] #NEWLINE# #UNINDENT# except NameError : #NEWLINE# #INDENT# parents = None #NEWLINE# #UNINDENT# sup = super ( EntityFormMetaclass , cls ) #NEWLINE# if ( not parents ) : #NEWLINE# #INDENT# return sup . __new__ ( cls , name , bases , attrs ) #NEWLINE# #UNINDENT# opts = ModelFormOptions ( attrs . get ( 'Meta' , None ) ) #NEWLINE# if opts . model : #NEWLINE# #INDENT# formfield_callback = attrs . get ( 'formfield_callback' , None ) #NEWLINE# proxy_fields = proxy_fields_for_entity_model ( opts . model , new_attrs . fields , opts . exclude , opts . widgets , formfield_callback ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# proxy_fields = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# new_attrs = proxy_fields . copy ( ) #NEWLINE# new_attrs . update ( attrs ) #NEWLINE# new_class = sup . __new__ ( cls , name , bases , new_attrs ) #NEWLINE# new_class . proxy_fields = proxy_fields #NEWLINE# return new_class