Making it compatible with mongoengine