#NEWLINE# def get_mixins( func , ignored_modules = None ) : #NEWLINE# #INDENT# '\n        Given a Django class-based view, return names and paths to applied mixins\n        Has an optional argument for names of modules that should be ignored.\n        Note that there could be decorators on the methods of the class (or on methods of the\n        mixins), but as with decorators, being sure of finding them all is impossible, so we simply\n        list the mixins.\n    ' #NEWLINE# ignored_modules = ( ignored_modules if ignored_modules else [ ] ) #NEWLINE# mixins = [ ] #NEWLINE# if hasattr ( func , 'cls' ) : #NEWLINE# #INDENT# for klass in func . cls . mro ( ) : #NEWLINE# #INDENT# if ( ( klass != func . cls ) and ( klass . __module__ . split ( '.' ) [ 0 ] not in ignored_modules ) ) : #NEWLINE# #INDENT# mixins . append ( '{}.{}' . format ( klass . __module__ , get_func_name ( klass ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return mixins