#NEWLINE# def modelresource_factory( model , resource_class = ModelResource ) : #NEWLINE# #INDENT# '\n    Factory for creating ``ModelResource`` class for given Django model.\n    ' #NEWLINE# attrs = { #NEWLINE# #INDENT# 'model' : model , #NEWLINE# #UNINDENT# } #NEWLINE# Meta = type ( str ( 'Meta' ) , ( object , ) , attrs ) #NEWLINE# class_name = ( model . __name__ + str ( 'Resource' ) ) #NEWLINE# class_attrs = { #NEWLINE# #INDENT# 'Meta' : metaclass , #NEWLINE# #UNINDENT# } #NEWLINE# metaclass = ModelDeclarativeMetaclass #NEWLINE# return metaclass ( class_name , ( resource_class , ) , class_attrs )