Skip to content

Commit

Permalink
Move default value of 'expand__to_dot' to a variable (#499) (#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheName authored and honzakral committed Jan 23, 2018
1 parent a455fdd commit f64b317
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elasticsearch_dsl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .exceptions import UnknownDslObject, ValidationException

SKIP_VALUES = ('', None)
EXPAND__TO_DOT=True

def _wrap(val, obj_wrapper=None):
if isinstance(val, dict):
Expand Down Expand Up @@ -213,7 +214,7 @@ def get_dsl_class(cls, name):
except KeyError:
raise UnknownDslObject('DSL class `%s` does not exist in %s.' % (name, cls._type_name))

def __init__(self, _expand__to_dot=True, **params):
def __init__(self, _expand__to_dot=EXPAND__TO_DOT, **params):
self._params = {}
for pname, pvalue in iteritems(params):
if '__' in pname and _expand__to_dot:
Expand Down

0 comments on commit f64b317

Please sign in to comment.