'Helper method to call to_mongo with proper inputs.'

def _to_mongo_safe_call(self, value, use_db_field=True, fields=None):

    f_inputs = self.to_mongo.__code__.co_varnames
    ex_vars = {}
    if ('fields' in f_inputs):
        ex_vars['fields'] = fields
    if ('use_db_field' in f_inputs):
        ex_vars['use_db_field'] = use_db_field
    return self.to_mongo(value, **ex_vars)
