Update dict from the attributes of a module, class or other object.

        By default only attributes with all-uppercase names will be retrieved.
        Use the ``criterion`` argument to modify that behaviour.

        :arg obj: Either the actual module/object, or its absolute name, e.g.
            'my_app.settings'.

        :arg criterion: Callable that must return True when passed the name
            of an attribute, if that attribute is to be used.
        :type criterion: :py:class:`function`

        .. versionadded:: 1.0

def update_from_object(self, obj, criterion=lambda key: key.isupper()):
        """
        Update dict from the attributes of a module, class or other object.

        By default only attributes with all-uppercase names will be retrieved.
        Use the ``criterion`` argument to modify that behaviour.

        :arg obj: Either the actual module/object, or its absolute name, e.g.
            'my_app.settings'.

        :arg criterion: Callable that must return True when passed the name
            of an attribute, if that attribute is to be used.
        :type criterion: :py:class:`function`

        .. versionadded:: 1.0
        """
        log.debug('Loading config from {0}'.format(obj))
        if isinstance(obj, basestring):
            if '.' in obj:
                path, name = obj.rsplit('.', 1)
                mod = __import__(path, globals(), locals(), [name], 0)
                obj = getattr(mod, name)
            else:
                obj = __import__(obj, globals(), locals(), [], 0)
        self.update(
            (key, getattr(obj, key))
            for key in filter(criterion, dir(obj))
        )