create a common function to convert mongoengine to python dictionnary