def modelresource_factory(model, resource_class=ModelResource):
 attrs = {u'model': model}
 Meta = type(str(u'Meta'), (object,), attrs)
 class_name = (model.__name__ + str(u'Resource'))
 class_attrs = {u'Meta': Meta}
 metaclass = ModelDeclarativeMetaclass
 return metaclass(class_name, (resource_class,), class_attrs)

def modelresource_factory ( model , resource_class = ModelResource ) : attrs = { u'model' : model } Meta = type ( str ( u'Meta' ) , ( object , ) , attrs ) class_name = ( model . __name__ + str ( u'Resource' ) ) class_attrs = { u'Meta' : Meta } metaclass = ModelDeclarativeMetaclass return metaclass ( class_name , ( resource_class , ) , class_attrs )
factory for creating modelresource class for given django model .