I ended up figuring this out after digging and digging. I couldn't find anything built in that did what I created. What I did was created a HelperMethod class with some static methods. Here is was I came up with:
class HelperMethods:
@staticmethod
def obj_to_dict(object):
return_data = {}
for property, value in vars(object).iteritems():
return_data[property] = value
return return_data['_data']
@staticmethod
def obj_to_list(objects):
return_data = []
for object in objects:
return_data.append(HelperMethods.obj_to_dict(object))
return return_data
Usage:
return self.create_response(request, HelperMethods.obj_to_list(drivers))
Hope this helps someone.