#NEWLINE# def types( model_cls ) : #NEWLINE# #INDENT# attr_name = b'{0}_types' . format ( model_cls . __name__ . lower ( ) ) #NEWLINE# types = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for plugin in find_plugins ( ) : #NEWLINE# #INDENT# plugin_types = getattr ( plugin , attr_name , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# for field in types : #NEWLINE# #INDENT# if ( ( field in types ) and ( plugin_types [ field ] != types [ field ] ) ) : #NEWLINE# #INDENT# raise PluginConflictException ( 'Plugin {0} defines flexible field {1} which has already been defined with another type.' . format ( plugin . name , field ) ) #NEWLINE# #UNINDENT# #UNINDENT# types . update ( plugin_types ) #NEWLINE# #UNINDENT# return types