Apply options from a serialized body to the current instance. Modifies
        the object in-place. Used mostly by ``from_dict``.

def update_from_dict(self, d):
        """
        Apply options from a serialized body to the current instance. Modifies
        the object in-place. Used mostly by ``from_dict``.
        """
        d = d.copy()
        if 'query' in d:
            self.query._proxied = Q(d.pop('query'))
        if 'script' in d:
            self._script = d.pop('script')
        self._extra = d
        return self